Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a program that helps the user decide what type of lottery game to play. Specifications: In some fictional state, there are 3 different
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.
Step by Step Solution
★★★★★
3.36 Rating (140 Votes )
There are 3 Steps involved in it
Step: 1
Certainly Heres a simple Java program that fulfills the specifications you provided java import javautilScanner public class LotteryGame public static ...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