Write a lottery system that awards participants with lucky ticket numbers as follows: Ticket numbers divisible...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a lottery system that awards participants with lucky ticket numbers as follows: Ticket numbers divisible by 3 or 5 get 100 dollars 2) 1) Ticket numbers divisible by both 3 and 5 get 200 dollars Ticket numbers not divisible by 3 nor 5 get no reward. Display a message saying they were not lucky enough 3) Note that valid ticket numbers must have 4 digits. Sample run 1: Claim your lottery prize. Please enter your ticket number:1020 Congrats, you won 200 II Sample run 2: Claim your lottery prize. Please enter your ticket number:1017 Congrats, you won 100 S! Sample run 2: Claim your lottery prize. Please enter your ticket number:1017 Congrats, you won 100 $I! Sample run 3 Claim your lottery prize. Please enter your ticket number:1016 Sorry..Better luck next time Sample run 4: Claim your lottery prize. Please enter your ticket number:864 Invalid ticket Number Write a lottery system that awards participants with lucky ticket numbers as follows: Ticket numbers divisible by 3 or 5 get 100 dollars 2) 1) Ticket numbers divisible by both 3 and 5 get 200 dollars Ticket numbers not divisible by 3 nor 5 get no reward. Display a message saying they were not lucky enough 3) Note that valid ticket numbers must have 4 digits. Sample run 1: Claim your lottery prize. Please enter your ticket number:1020 Congrats, you won 200 II Sample run 2: Claim your lottery prize. Please enter your ticket number:1017 Congrats, you won 100 S! Sample run 2: Claim your lottery prize. Please enter your ticket number:1017 Congrats, you won 100 $I! Sample run 3 Claim your lottery prize. Please enter your ticket number:1016 Sorry..Better luck next time Sample run 4: Claim your lottery prize. Please enter your ticket number:864 Invalid ticket Number
Expert Answer:
Answer rating: 100% (QA)
Solution Have a look at the below code I have put comments wherever requi... View the full answer
Posted Date:
Students also viewed these general management questions
-
You have won a contest. Your prize consists of 5 payments of $10,000 made at the end of years 2, 4, 6, 8 and 10 (assume that "right now" equals time zero), or a one-time lump-sum cash payment made at...
-
A lottery ticket has a grand prize of $28 million. The probability of winning the grand prize is .000000023. Based on the expected value of the lottery ticket, would you pay $1 for a ticket? Show...
-
Divisible by 4 or divisible by 7 In a lottery game, a single ball is drawn at random from a container contains 25 identical balls numbered from 1 through 25. In problem, use equation (1) or (2),...
-
Many auditors consider the substantiation of the figure for inventory to be a more difficult and challenging task than the verification of most other items on the balance sheet. List several specific...
-
Oakdale Fashions, Inc., had $245,000 in 2015 taxable income. Using the tax schedule in Table, calculate the companys 2015 income taxes. What is the average tax rate? What is the marginal tax rate?
-
At last year's Southern Florida Amateur Tennis Championships there were 1,947 entries in the women's singles. This is a standard knockout tournament, so how many matches did the organisers have to...
-
Discuss the key features of Section 302 of the Sarbanes-Oxley Act.
-
You are considering buying stock A. If the economy grows rapidly, you may earn 30 percent on the investment, while a declining economy could result in a 20 percent loss. Slow economic growth may...
-
The Mobile Oil Company has just purchased an asset they intend to use in their business. The machine has a cost of $100m and they intend to depreciate this for 10 years straight line. The taxation...
-
YWS is considering the purchase of equipment for $100,000 to fund a program that will provide the following cash inflows: Year 1 - $25,000, Year 2 - $40,000, and Year 3 - $50,000. Calculate the...
-
You are trying to decide how much to save for retirement. Assume you plan to save $5,000 per year with the first investment made one year from now. You think you can eam 6.5% per year on your...
-
A company budgeted fixed overhead for the month to be $5,000. During the month a total of $4,700 of fixed overhead was applied to production and actual fixed overhead was $5,200. The fixed overhead...
-
After 9/11, the federal government announced a major program to conduct "voluntary" interviews with 5,000 holders of temporary visas from Arab countries thought to have significant ties to Al Qaeda....
-
After a few minutes, Elaine returned to the meeting with Debra, who was dressed in a flannel shirt, dirty jeans, and a baseball cap. David pushed to the front of the group and loudly said, Hi ,...
-
8 2 . On January 1 , 2 0 2 4 , Cougar Corp. purchased a machine for $ 6 0 0 , 0 0 0 . The corporation estimated a 4 - year useful life ( or 9 0 0 , 0 0 0 units of useful life ) and $ 6 0 , 0 0 0...
-
What Does 5-d Mean? What Are Some Of The Uses Of Bim? What Are Some Of The Benefits Of Bim? What Are Some Of The Barriers To Industry Implementation? What Type Of Barriers Will I Encounter While...
-
Problem 15-23 (Static) (LO 15-7) The Drysdale, Koufax, and Marichal partnership has the following balance sheet immediately prior to liquidation: Cash Noncash assets $ 36,000 204,000 Liabilities...
-
Funds are separate fiscal and accounting entities, each with its own self-balancing set of accounts. The newly established Society for Ethical Teachings maintains two funds-a general fund for...
-
EuroVirtuals EPS Sensitivity to Exchange Rates (A). On January 15, 2015 the Swiss National Bank (SNB) decided to unpeg the franc, which was fixed at CHF1.20/ since 2011. Suppose the SNB was to...
-
EuroVirtuals Consolidated Earnings. EuroVirtual pays different tax rates for each of its country operations. a. What are its earnings per share in EUR after deducting taxes? b. What is the proportion...
-
EuroVirtuals EPS and Euro Appreciation/ Depreciation. Since its introduction in 2003, the euro has been fluctuating against major global currencies. a. What is the impact of 15% appreciation of all...
Study smarter with the SolutionInn App