Question: JAVA!!!!!! Using the inner class discussed in class, simulate that you are playing Pega 5 : The program should continue to run until one of

JAVA!!!!!! Using the inner class discussed in class, simulate that you are playing Pega5:
The program should continue to run until one of two situations occurs:
1. Press Ok from the JOptionPane (if you press the button it should say "You lost !!!").
2. If the entered number comes out in Pega5, it should say You won!.
They must implement an interface called ask(). Which will ask the desired number.
The interval that is every 1 second and that makes a "beep". Show how many rolls were made.
Note: Investigate how to generate random numbers. Remember that Pega5 goes from 00000 to 99999.
The output would be as follows:
---------------------------------------------------------------------------------------------------
Enter desired number: 32636
04/20/202209:50:23:
Spin #1: 43925
Spin #2: 83984
You lost !!!
---------------------------------------------------------------------------------------------------
Enter desired number: 49134
04/20/202209:51:10
Spin #1: 49376
Roll #2: 94502
Spin #3: 49134
You won !!!

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!