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...
-
Hummer Company uses manufacturing cells to produce its products (a cell is a manufacturing unit dedicated to the production of subassemblies or products). One manufacturing cell produces small motors...
-
Determine the force in members GF, GD, and CD of the truss and state if the members are in tension orcompression. 260 Ib 4 ft 12 3ft 3 ft IF -4 ft- - 4 4 ft- -4 ft
-
Creusot-Loire, a French company, was the project engineer for the construction of ammonia plants in former Yugoslavia and Syria. Creusot-Loire contracted with Coppus Engineering for the purchase of...
-
The Personnel Department at Drumm Corporation is centralized and provides services to the two operating units: Illinois and Ohio. The Illinois unit is the original unit of Drumm and is well...
-
16. Using the given data find value of resonance energy of benzene C6H6. AydgH of cyclohexene = -119 kJ/mole AhydgH of benzene = -206.5 kJ/mole (a) -150.5 kJ/mole (b) -325.5 kJ/mole (c) -87.5 kJ/mole...
-
Quigley Corporations trial balance at December 31, 2020, is presented below. All 2020 transactions have been recorded except for the items described below. Unrecorded transactions and adjustments: 1....
-
Noble issued preferred stock with a $9 dividend per year. The investment bank paid Noble $72 per share for the stock and then sold the stock to investors for $75 per share. a. If you buy the stock...
-
What type of sales position would you recommend for each of the following? a. A four-person gastroenterology practice that wants to maintain strong ties. to its primary care referral physicians b. A...
-
Vigenre cipher. The trouble with a monoalphabetic cipher is that it can be easily broken by frequency analysis. The so-called Vigenre cipher overcomes this problem by encoding a letter into one of...
-
When a client program communicates with a server, it sometimes needs to flush the output stream. Explain why.
-
The American Academy of Pediatrics wants to conduct a survey of recently graduated family practitioners to assess why they did not choose pediatrics for their specialization. Provide a definition of...
-
Enhance the program of Exercise E22.3 by supplying a variable number of producer and consumer threads. Prompt the program user for the numbers. Data from exercise 22.3 Implement a Queue class whose...
-
MOSS COMPANY Income Statement \ table [ [ , ] , [ Sales For Year Ended December 3 1 , 2 0 2 1 , $ 5 2 5 , 0 0 0 es MOSS COMPANY Income Statement For Year Ended December 31, 2021 Sales Cost of goods...
-
Suppose that a company has 10.000 outstanding shares in the beginning of the year. On April 1st, the company increases its shares by 6.000. On July 1st, the company increases its shares again, but...
-
Identify the sources and discuss the consequences of bank runs, bank panics, and financial crises.
-
Explain why and how the government intervenes in the financial system, and the problems the government safety net creates.
-
In the absence of limits on the behavior of large intermediaries, how might the perception of institutions being too-big-to-fail lead to increased concentration in the banking industry?
Study smarter with the SolutionInn App