Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that plays the game of guess the number as follows: Your program choses the number to be guessed by selecting an integer

Write a program that plays the game of guess the number as follows:
Your program choses the number to be guessed by selecting an integer at random in the range 1 to 3000. The program then types:
I have a number between 1 and 3000.
Can you guess my number?
Please type your first guess.
The player then types a first guess. The program responds with one of the following:
1. Excellent! You guessed the number!
Would you like to play again (y or n)?
2. Too low. Try again.
3. Too high. Try again.
If the players guess is incorrect, your program should loop until the player finally gets the number right. Your program should keep telling the player Too low. Try again or Too high. Try again to help the player to find the correct answer

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

JDBC Database Programming With J2ee

Authors: Art Taylor

1st Edition

0130453234, 978-0130453235

More Books

Students also viewed these Databases questions