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:

  1. 44% of the points are allocated to Documentation.
  2. 56% of the points are allocated to programming.

Documentation:

  1. Explain the purpose of the program as detail as possible - 13%.
  2. Develop a solution for the problem and mention algorithms to be used - 16%.
  3. List data structures to be used in solution. - 5%.
  4. Give a description of how to use the program and expected input/output - 5%.
  5. Explain the purpose of each class you develop in the program. - 5%.

Programming:

  1. For each method, give the pre and post conditions and invariant, if any - 10%.
  2. Program execution according to the requirements given - 36%.
  3. Naming of program as required - 5%.
  4. 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:

  1. The program must prompt the user to enter the amount of tickets he/she wants to purchase (must be between 1 and 5)
  2. A ticket will be made up of two sets of numbers - a group of 5 numbers and another group of 1 number.
  3. The numbers must be randomly generated from the range of 1 - 56 for Group 1 and 1 - 46 for Group 2.
  4. There must  be no repetition of numbers in the same group.
  5. 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).
  6. You are to use vectors to store the lottery numbers.
  7. 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.
  8. Sort the numbers in Group 1 in ascending order  for each ticket purchased.
  9. 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:
  1. 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.
  2. A print out of each of the .java files (source code).
  3. Make sure that your name is written clearly both on the print out and the disk.
  4. Make sure that both the .java and .class OR .jar files are on the root directory i.e. on the a:\  drive. Example:   
  5. Should you use any subdirectory (whatsoever) your program would not be graded and you will receive a 0 (zero).