Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

home / study / engineering / computer science / computer science questions and answers / in chapter 1, you created a class called randomguess. in

home / study / engineering / computer science / computer science questions and answers / in chapter 1, you created a class called randomguess. in this game, players guess a number, ... Question: In Chapter 1, you created a class called RandomGuess. In this game, players guess a number, the a... In Chapter 1, you created a class called RandomGuess. In this game, players guess a number, the application generates a random number, and players determine whether they were correct. Now that you can make decisions, modify the application so it allows a player to enter a guess before the random number is displayed and then displays a message indicating whether the players guess was correct, too high, or too low. Save the file as RandomGuess2.java. This is the class I created in Chapter 1: import javax.swing.JOptionPane; public class GameZone1 { public static void main(String[] args) { JOptionPane.showMessageDialog(null, "Think of a number between 1 and 10"); JOptionPane.showMessageDialog(null, "The number is "+ (1 + (int)(Math.random() * 10))); } }

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 Internals A Deep Dive Into How Distributed Data Systems Work

Authors: Alex Petrov

1st Edition

1492040347, 978-1492040347

More Books

Students also viewed these Databases questions

Question

What is an increasing function?

Answered: 1 week ago