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%
- I just want to be a basic program.
Hi, I have read the requirements and I would like to do this project if given the opportunity. I am a computer science practitioner and having the "C++ and Algorithms Certification Badge" in my profile gives me confidence and assurance that I can deliver you the project as required. Let me know if you are interested so I can start. Thanks.
$20 USD in 0 day
5.0 (408 reviews)
6.6
6.6
2 freelancers are bidding on average $25 USD for this job
see my c++ work history
see my c++ work history
see my c++ work history
see my c++ work history
see my c++ work history
see my c++ work history
see my c++ work history
see my c++ work history