Department
of Computer Science.
Georgia State University
CSc 2311
Spring 2008 - Assign#2
J. L. Bhola
Due: February 7th, 2008.
Note: (1) For all
assignments, always use comments to explain your program.
(2)
No copying allowed. If it is
found that students copy from each other, all of these programs will
get 0.
(3)
You must use the name given to name your
program.
Should you use a different
name, you would lose 10% of what
the program is worth.
Description
of program:
You are to write a program
name megaMillion.cpp.
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 arrays 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) consisting of the .cpp
and the .exe file. MAKE SURE THAT YOUR DISK IS VIRUS CLEAN.
- A print out of each of the .cpp files (source code).
- Make sure that your name is written clearly both on the print out
and the disk.
- Make sure that both the .cpp and .exe files are on the root
directory i.e. on the a:\ drive. Example:
- a:\megaMillion.cpp
- a:\megaMillion.exe
- Should you use any subdirectory (whatsoever) your program would
not be graded and you will receive a 0 (zero).