Please write in Java: 1. Guess number. Write a program to: a. Generate a random integer between 1 and 100 (inclusive) an

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Please write in Java: 1. Guess number. Write a program to: a. Generate a random integer between 1 and 100 (inclusive) an

Post by answerhappygod »

Please write in Java:
1. Guess number. Write a program to:
a. Generate a random integer between 1 and 100 (inclusive) andprompt user to guess the number.
b. If the guess is not right, give the user the hint like“higher”, “lower”. Allow the user to retry and input the newguess
. c. Likely you want to use a while loop to support the user’smultiple attempts. Stop the loop when the user guessed the correctnumber.
d. Print out the number of attempts for the user for this roundof game.
e. Allow one to play the guess number games as many times as onewants. Make sure one has a way to stop the application (e.g. byinputting a special string “no” when asked about whether one wantto print the game again.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply