A lottery machine program generates random numbers as follows: 1. All generated numbers should be unique...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 ;) 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 ;)
Expert Answer:
Answer rating: 100% (QA)
Thanks for the question Below is the C code you will be needing Let me know if you have an... View the full answer
Related Book For
Business Statistics A First Course
ISBN: 978-0321979018
7th edition
Authors: David M. Levine, Kathryn A. Szabat, David F. Stephan
Posted Date:
Students also viewed these accounting questions
-
A lottery winner told how he picked his six-digit winning number (5-6-8-10-22-39): number of people in his family, birth date of his wife, school grade of his 13-year-old daughter, sum of his birth...
-
Many states prohibit their lottery tickets from being sold out of the state, so Pic-A-State would have its agents buy lottery tickets in various states and hold them there; someone in Pennsylvania...
-
The lucky winner of a lottery was given an option. She could either receive $1 million a year for 20 years, for a total of $20 million, or simply receive $10 million today. Why would anyone take the...
-
In Problems 5994, solve each inequality. Express your answer using set notation or interval notation. Graph the solution set. 2x2 3 + x
-
Sherrys utility is US and her income is YS. Marshas utility is UM and her income is YM. Suppose it is the case that: Define the Pareto efficient redistribution, and explain why the concept is...
-
Find dy/dt. y = tan x; dx/dt = 3, x = /4
-
Calculate the speed of sound in air, helium, and hydrogen. The temperature is \(70^{\circ} \mathrm{F}\).
-
George Company manufactures a computer with an estimated economic life of 12 years and leases it to National Airlines for a period of 10 years. The normal selling price of the equipment is $278,072,...
-
How do synthetic biology and metabolic engineering contribute to the development of novel bioprocessing systems for industrial biotechnology, and what are the implications for production efficiency...
-
ASAP Delivery is a small company that transports business packages between San Francisco and Los Angeles. It operates a fleet of small vans that moves packages to and from a central depot within each...
-
A deuce in a tennis match is when both players are tied at three points each. If you ever watch tennis, when the score is a deuce, the player that wins the next point is said to have the advantage,...
-
What are the basic features of statutory corporation?
-
What is continuous audit? In which case is this audit applicable? State the advantages and disadvantages of continuous audit.
-
State what information you would require and what documentary evidence you would see while vouching the following (a) Freight, Carriage and Custom duty. (b) Commission paid to sole-selling agent. (c)...
-
What are special and general qualifications that an auditor should possess and why?
-
Discuss the advantages of audit (a) to the management (b) to the Government (c) to the shareholders and (d) to the society.
-
For the diagrams below, use a different color to trace over the nerves listed in the table above (you may want to use the same colors as the online model). Then IDENTIFY each nerve on the models in...
-
Prove the following D,(cos x) = - sin x (Hint: Apply the identity cos(A + B) = cos A cos B sin A sin B)
-
Refer to Problem 5.22. How many cookies in a batch of 100 should the manager expect to discard if company policy requires that all chocolate- chip cookies sold have at least four chocolate-chip...
-
The file Property Taxes contains the property taxes per capita for the 50 states and the District of Columbia. Decide whether the data appear to be approximately normally distributed by a. Comparing...
-
The manufacturer of Boston and Vermont asphalt shingles provides its customers with a 20- year warranty on most of its products. To determine whether a shingle will last through the warranty period,...
-
Find each probability using the standard normal distribution. (a) \(P(z>-1.68)\) (b) \(P(z <2.23)\) (c) \(P(-0.47
-
Find the probability that a randomly selected person has an IQ score between 95 and 105. Is this an unusual event? Explain. In a standardized IQ test, scores are normally distributed, with a mean...
-
The random variable \(x\) is normally distributed with the given parameters. Find each probability. (a) \(\mu=9.2, \sigma \approx 1.62, P(x <5.97)\) (b) \(\mu=87, \sigma \approx 19, P(x>40.5)\) (c)...
Study smarter with the SolutionInn App