Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Sample outputs: Welcome to the Super Lottery! Let's Play! Round 1 - you have 5 chances to win money Enter your guess: 34 The lottery

image text in transcribedSample outputs:

Welcome to the Super Lottery!

Let's Play!

Round 1 - you have 5 chances to win money

Enter your guess: 34

The lottery number is 24

You guessed one number! You win $1!

Enter your guess: 21

The lottery number is 12

You guessed both numbers, but in a different order! You win $10!

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 $1012

Play again? (enter yeso): yes

Total winnings over 1 rounds is $ 1012

Let's play again!!!

Round 2 - you have 5 chances to win money

Enter your guess: 87

The lottery number is 77

You guessed one number! You win $1!

Enter your guess: 65

The lottery number is 87

Good luck next time! You still have 3 guesses.

Enter your guess: 22

The lottery number is 13

Good luck next time! You still have 2 guesses.

Enter your guess: 90

The lottery number is 29

You guessed one number! You win $1!

Enter your guess: 35

The lottery number is 40

Good luck next time!

End of round. You won $2

Play again? (enter yeso): yes

Total winnings over 2 rounds is $ 1014

Let's play again!!

Round 3 - you have 5 chances to win money

Enter your guess: 38

The lottery number is 38

CONGRATULATIONS! You win the Super Lottery! $1000!

Enter your guess: 98

The lottery number is 47

Good luck next time! You still have 3 guesses.

Enter your guess: 20

The lottery number is 28

You guessed one number! You win $1!

Enter your guess: 21

The lottery number is 12

You guessed both numbers, but in a different order! You win $10!

Enter your guess: 33

The lottery number is 88

Good luck next time!

End of round. You won $1011.0

Play again? (enter yeso): no

Total winnings over 3 rounds is $ 2025

Top round: Round 1 winnings $ 1012

Goodbye!

Use Java please!!

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:

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

1 2 3 Data Base Techniques

Authors: Dick Andersen

1st Edition

0880223464, 978-0880223461

More Books

Students also viewed these Databases questions

Question

4. Who should be invited to attend?

Answered: 1 week ago

Question

7. How will you encourage her to report back on the findings?

Answered: 1 week ago