Write a program to simulate a lottery drawing which uses balls that are numbered from 1 to 10.

Assume that three balls are drawn at random and the number are unique for each draw. (all 3 numbers must be different). Allow a user to enter the number of lottery drawings to simulate. The program must validate the input. For example, number of drawing can't be negative.

The program must not quit in case an input is incorrect.

The program must output the following:

1) What percentage of the time does a draw contain three even numbers in the simulation?

2) What percentage of the time does the number 7 occur in the set of three numbers in the simulation?

3) What percentage of the time does the system draw 1, 2, and 3 (in any order) in the simulation?

OUTPUT (This format MUST be followed)

Enter number of lottery drawings =>10

Draw #1:

First: 5

Second: 6

Third: 3

Draw #2:

First: 3

Second: 2

Third: 7

Draw #3:

First:10

Second: 4

Third: 9

Draw #4:

First: 1

Second:10

Third: 5

Draw #5:

First: 7

Second: 1

Third: 2

Draw #6:

First: 9

Second:10

Third: 6

Draw #7:

First: 4

Second: 1

Third: 6

Draw #8:

First: 8

Second: 2

Third: 6

Draw #9:

First: 1

Second: 5

Third: 8

Draw #10:

First: 2

Second: 5

Third: 4

Occurrence of all even:10.00%

Occurrence of sevens:20.00%

Occurrence of 1-2-3 (any order):0.00%

Academic Honesty!

It is not our intention to break the school's academic policy. Projects posted are only used as a reference
and should not be submitted as is. We are not held liable for any misuse of the solutions.
Please see the frequently asked questions page
for further questions and inquiries.