Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Step: 3

blur-text-image

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

Database Design For Mere Mortals

Authors: Michael J Hernandez

4th Edition

978-0136788041

More Books

Students also viewed these Databases questions

Question

Explain the various ways to protect employees.

Answered: 1 week ago