Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The goal of this exercise is to program a Guess My Number game. When it's finished, it will work like this: I'm thinking of a

image text in transcribed
The goal of this exercise is to program a "Guess My Number" game. When it's finished, it will work like this: I'm thinking of a number between 1 and 100 (including both). Can you guess what it is? Type a number: 45 Your guess is: 45 The number I was thinking of is: 14 You were off by: 31 To choose a random number, you can use the Random class in java.util. Here's how it works: import java.util.Random: public class GuessStarter { public static void main(String[] args) { // pick a random number Random random = new Random(): int number = random.nextInt(100) + 1: System.out.println(number): } }

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

The Database Experts Guide To Database 2

Authors: Bruce L. Larson

1st Edition

0070232679, 978-0070232679

More Books

Students also viewed these Databases questions

Question

how would you have done things differently?

Answered: 1 week ago

Question

3. What information do participants need?

Answered: 1 week ago