Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

you can copy the following statement to generate and use a dialog box that displays a random number between 1 and 10: JOptionPane.showMessageDialog(null,The number is

you can copy the following statement to generate and use a dialog box that displays a random number between 1 and 10:

JOptionPane.showMessageDialog(null,"The number is "+

(1 + (int)(Math.random() * 10)));

Write a Java application that displays two dialog boxes in sequence. The first asks you to think of a number between 1 and 10. The second displays a randomly generated number; the user can see whether his or her guess was accurate. (In future chapters, you will improve this game so that the user can enter a guess and the program can determine whether the user was correct. If you wish, you also can tell the user how far off the guess was, whether the guess was high or low, and provide a specific number of repeat attempts.)

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

Beginning ASP.NET 2.0 And Databases

Authors: John Kauffman, Bradley Millington

1st Edition

0471781347, 978-0471781349

More Books

Students also viewed these Databases questions

Question

Why should an employer be concerned about negligent hiring?

Answered: 1 week ago

Question

What are the various methods of interviewing? Define each.

Answered: 1 week ago