Question: Write a program that imitate power ball lottery game. 1. In this game system, there are three balls: two white balls and one red ball.

Write a program that imitate power ball lottery game.

1. In this game system, there are three balls: two white balls and one red ball. The game should randomly generate integer number for each ball. The number range for the white ball is 1~3, and for the red ball is 1~2.

(Random class )

2. Ask the customer enter any three integer numbers to guess.

(Scanner class )

3. The rule of games is to get the number and win:

a. Any one white ball: $10

b. Any one white ball+ red ball: $40

c. Two white balls: $30

d. Two white balls+ red ball: $80

e. Nothing: oops, good luck next time

(Conditional statement )

4. Output information:

a. Each balls number randomly generated by the game system.

b. Each guessed number inputted by the customer.

c. The result of prize.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!