Department
of Computer Science.
Georgia State University
CSc 3410
Fall 2008 - Assign#1
J. L. Bhola
Due: September 3rd, 2008 & September 4th, 2008.
Allocation of points for all assignments:
- 44% of the points are allocated to Documentation.
- 56% of the points are allocated to programming.
Documentation:
- Explain the purpose of the program as detail as possible - 13%.
- Develop a solution for the problem and mention algorithms to be used - 16%.
- List data structures to be used in solution. - 5%.
- Give a description of how to use the program and expected input/output - 5%.
- Explain the purpose of each class you develop in the program. - 5%.
Programming:
- For each method, give the pre and post conditions and invariant, if any - 10%.
- Program execution according to the requirements given - 36%.
- Naming of program as required - 5%.
- Print out of source code - 5%.
Description
of program:
You are to write a program
name megaMillion.java. You must use vectors as
your data structure.
Here
are some requirements
for the program:
- The program must prompt the user to enter the amount of tickets
he/she wants to purchase (must be between 1 and 5)
- A ticket will be made up of two sets of numbers - a group of 5
numbers and another group of 1 number.
- The numbers must be randomly
generated from the range of 1 - 56 for Group 1 and 1 - 46 for Group 2.
- There must be no
repetition of numbers in the same group.
- However, if the user wants for example 2 tickets, then it is
possible for these two tickets to differ by only 1 number (so
repetition between tickets are allowed providing that the 2 tickets
are not identical).
- You are to use vectors to store the lottery numbers.
- The program must also prompt the user asking him/her if he/she
wants to buy more tickets. If answer is "yes" rerun the program. If
"no" terminate the program. If "yes" the random
generator must start back from time 0.
- Sort the numbers in Group 1
in ascending order for each ticket purchased.
- Then display all of the tickets purchased by the user on the
screen in the order of Group 1
followed by the single number in Group
2.
What to turn in:
- A 3.5 inches floppy disk (IBM compatible) or CD consisting of the .java
and the .class or .jar file. MAKE SURE THAT YOUR DISK IS VIRUS CLEAN.
- A print out of each of the .java files (source code).
- Make sure that your name is written clearly both on the print out
and the disk.
- Make sure that both the .java and .class OR .jar files are on the root
directory i.e. on the a:\ drive. Example:
- a:\megaMillion.java or Main.java
- a:\megaMillion.class or megaMillion.jar
- Should you use any subdirectory (whatsoever) your program would
not be graded and you will receive a 0 (zero).