Answered step by step
Verified Expert Solution
Question
1 Approved Answer
A lottery machine program generates random numbers as follows: 1. All generated numbers should be unique 2. All generated numbers have 5-digit length 3.
A lottery machine program generates random numbers as follows: 1. All generated numbers should be unique 2. All generated numbers have 5-digit length 3. The machine generates 100 random lottery tickets (numbers) and pick ONLY two lucky tickets from it as a winner A user can try his luck as many as he can, the lottery program quit when the user press Q or q. A program should quit also when the user won. Develop a C program to perform the lottery program as functions, and call them from the main: StartLottery function, to start the lottery machine program as specified above PlayGame function, to prompt the user to enter a 5-digit number u press Q or q character. The same function will call another function WinOrLoss WinOrLoss function, to test if the user won or no by comparing the entered he/she number with the winner tickets Sample Output Welcome to The Lottery Program Press S or s to start the lottery - Press Q or q to quit Input a 5-digit number 11253 11253 is NOT the winner number, try your luck again [Q/q to quit] Input a 5-digit number 77862 | 11253 is NOT the winner number, try your luck again [Q/q to quit] Input a 5-digit number 84610 Cognates, You WON ;)
Step by Step Solution
★★★★★
3.41 Rating (170 Votes )
There are 3 Steps involved in it
Step: 1
Thanks for the question Below is the C code you will be needing Let me know if you have an...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started