Write a program that helps the user decide what type of lottery game to play. Specifications:...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program that helps the user decide what type of lottery game to play. Specifications: In some fictional state, there are 3 different lottery games a person can play: Three's Not a Crowd, Four Leaf Clover, and Big 5. The rules for each follow. • Three's Not a Crowd: The player chooses three different numbers in the range 1 - 15. The winning game has all 3 numbers correct and in the right order. The alternate win game has all 3 numbers, but in the wrong order. Cost to play: $3.00 Four Leaf Clover: Same as Three's a Crowd, but with 4 numbers in the range 1 - 20. Cost to play: $4.00 Big 5: The player chooses 4 different numbers as the hand and 1 number as the bonus number. The winning game has all 5 numbers correct, with the 4 hand numbers in any order. The alternate win has the 4 hand numbers correct (in any order), but not the bonus number correct. Cost to play: $5.00 The amount of winnings will be: • for the winning hand, $0.05 for each possible hand available • for the alternate hand, $0.01 for each possible hand available ● Write a program that lets the user choose a game to play. For whichever game the user chooses, the computer will generate the winning numbers and prompt the user to input the user's chosen numbers. The user should be asked how many tickets are to be purchased. For each ticket, the computer should compare the user's guesses to the winning numbers, keeping track of how many times the user's ticket(s) won the game. Output should show whether or not the user won (both winning game and alternate game results), how much the user spent, and how much was won. Write a program that helps the user decide what type of lottery game to play. Specifications: In some fictional state, there are 3 different lottery games a person can play: Three's Not a Crowd, Four Leaf Clover, and Big 5. The rules for each follow. • Three's Not a Crowd: The player chooses three different numbers in the range 1 - 15. The winning game has all 3 numbers correct and in the right order. The alternate win game has all 3 numbers, but in the wrong order. Cost to play: $3.00 Four Leaf Clover: Same as Three's a Crowd, but with 4 numbers in the range 1 - 20. Cost to play: $4.00 Big 5: The player chooses 4 different numbers as the hand and 1 number as the bonus number. The winning game has all 5 numbers correct, with the 4 hand numbers in any order. The alternate win has the 4 hand numbers correct (in any order), but not the bonus number correct. Cost to play: $5.00 The amount of winnings will be: • for the winning hand, $0.05 for each possible hand available • for the alternate hand, $0.01 for each possible hand available ● Write a program that lets the user choose a game to play. For whichever game the user chooses, the computer will generate the winning numbers and prompt the user to input the user's chosen numbers. The user should be asked how many tickets are to be purchased. For each ticket, the computer should compare the user's guesses to the winning numbers, keeping track of how many times the user's ticket(s) won the game. Output should show whether or not the user won (both winning game and alternate game results), how much the user spent, and how much was won.
Expert Answer:
Answer rating: 100% (QA)
Certainly Heres a simple Java program that fulfills the specifications you provided java import javautilScanner public class LotteryGame public static ... View the full answer
Related Book For
Microeconomics An Intuitive Approach with Calculus
ISBN: 978-0538453257
1st edition
Authors: Thomas Nechyba
Posted Date:
Students also viewed these databases questions
-
2. Consider a 3-year American call option on a stock which pays dividends in 1 year and 2 years. The first dividend is $5 and the second dividend is $6. The current stock price is $100, the exercise...
-
In this project, we will write a program that controls a quiz show, much like the many popular TV shows. The program will read in a group of questions and their multiple choice answers, storing them...
-
The following are selected transactions of Bridgeport Department Store Ltd. for the current year ended December 31. Bridgeport is a private company operating in the province of Manitoba where PST is...
-
Entries for Acquisition of Assets Presented below are information related to Rommel Company. 1. On July 6 Rommel Company acquired the plant assets of Studebaker Company, which had discontinued...
-
Evaluate: (a) 7! (b) 8! (c) 4! (d) 13!
-
(a) Determine the center-of-mass velocity of the two carts in Figure 6.8 (a) before and after the collision, and verify that it is equal to the velocity of the carts at the point where the two...
-
An investor wishes to invest some or all of his $12.5 million in a diversified portfolio through a commercial lender. The types of investments, the expected interest per year, and the maximum allowed...
-
1. The above image shows a thin lens of focal length 5m. (i) What is the kind of lens shown in the above figure? (ii) If a real inverted image is to be formed by this lens at a distance of 7m from...
-
Mr. M has been employed as an engineer by A Ltd., a company incorporated in Hong Kong. During the year ended 31 March 2019, Mr. M had the following income and expenditure. A monthly salary of...
-
A construction company is considering taking on a new project. The total project cost is $5 million, and there is a 70% chance that the project will be completed on time and within budget, resulting...
-
What are private portfolio flows? What factors do you believe are most important in determining the amount and direction of such flows?
-
Explain some of the arguments in support of the use of tariffs, quotas, and other trade barriers in developing countries.
-
Prepare a brief update on longer-term impacts of the 2008 global financial crisis. Have any of the later developments proved unexpected (or previously considered unlikely)? Where problems have...
-
Explain the distinction between primary and secondary inward- and outward-looking development policies.
-
Discuss the potential role of NGOs in relation to the government and private sectors.
-
Note: Solve all the above questions using Python. Use Pandas, Seaborn, Sklearn, etc. libraries for all the following analysis. Consider data given in file HW5DataA . Consider the following data...
-
The Ferris wheel in the figure has a radius of 68 feet. The clearance between the wheel and the ground is 14 feet. The rectangular coordinate system shown has its origin on the ground directly below...
-
Mergers and Antitrust Policy in Related Product Markets: In exercise 26.1, we investigated different ways in which the markets for good xi (produced by firm i) and good xj (produced by firm j) may be...
-
Public School Teacher Salaries, Class Size and Private School Markets: In exercise 14.10, we noted that private schools that charge tuition operate alongside public schools in U.S. cities. There is...
-
Suppose you are an amateur athlete and your uncle owns the cereal company Wheaties. Your uncle offers you a job working for his company at a wage of w per hour. After looking around for other jobs,...
-
As wind speed is reduced, what happens to the sediment carried by wind?
-
How are surface processes different from tectonic processes?
-
Why is topsoil essential to conserve and protect? (a) Topsoil holds subsoil in place, preventing landslides. (b) Plants require topsoil to growand plants are vital because they provide food and...
Study smarter with the SolutionInn App