Question
Need to be answered correctly. You must: Comment and Format and Must make sure about indenting. If you don't follow these steps, it will be
Need to be answered correctly. You must: Comment and Format and Must make sure about indenting. If you don't follow these steps, it will be flagged for review. MUST BE IN JAVA FORMAT. IT IS A MUST. Please also check the output very carefully. There is spacing in the output which must be maintained between each guesses. Plus, the output should generate: CONGRATULATIONS! You win the Super Lottery! $1000! even after 3 rounds????????
Need to be answered correctly. You must: Comment and Format and Must make sure about indenting. If you don't follow these steps, it will be flagged for review. MUST BE IN JAVA FORMAT. IT IS A MUST. Please also check the output very carefully. There is spacing in the output which must be maintained between each guesses. Plus, the output should generate: CONGRATULATIONS! You win the Super Lottery! $1000! even after 3 rounds????????
Exercise 3. Write a program to play a lottery game. A player gets to play 5 times (per round) to try and guess the super jackpot. The program generates a random two-digit number and prompts the player to input their two-digit guess. The player gets 5 chances in each round of the game. For each guess, the rules to determine the winnings are If the two digits match exactly the random number (in the right order), the player wins the super jackpot (S1000) If the two digits match (but not in the right order), the player wins S10 If one digit matches, the player wins $1 After a round of play (5 turns), print out the total winnings and ask the user if they want to play again (and if so, print the winnings over all rounds and start a new round of play). If they want to stop playing, print the total winnings over all rounds and the best round winnings (e.g., if they play four rounds and round two had the highest winnings, then print those winnings). See below for a description of random number generation. Provide - Printout of properly formatted source code Example output/test cases (2 test cases with at least 3 rounds each different than shown). A sample run Welcome to the Super Lotteryl Let's Playl Round 1 - you have 5 chances to win money Enter your guess: 34 The lottery number is 24 You guessed one number! You win $11 Enter your guess: 21 The lottery number is 12 You guessed both numbers, but in a different order You win $101 Enter your guess: 11 The lottery number is 90 Good luck next time! You still have 2 guesses Enter your guess: 42 The lottery number is 42 CONGRATULATIONS! You win the Super Jackpot $1000! Enter your guess: 22 The lottery number is 26 You guessed one number! You win $1 End of round. You won S1012 Play again? (enter yeso) yesStep by Step Solution
There are 3 Steps involved in it
Step: 1
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