Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

May I please get some help with programming something in java? Thank you. ------ Task: Guess Game - Write a Java program called guessGame.java to

May I please get some help with programming something in java? Thank you.

image text in transcribed

------ Task: Guess Game - Write a Java program called "guessGame.java" to implement the following problem. - Problem: A system randomly generates a winning number lies in the range [100,1000], and a user has 10 attempts to guess the winning number Declare two variables 'min' and 'max' and set their values to 100 and 1000 respectively. - Declare variable 'winningNum' and initialize it to a value randomly generated within the range [min,max] - Prompt the user for the first guessed value and store the value in a variable. Choose an appropriate name for this variable. - Then, the game begins by comparing the user-guessed number with the systemguessed number (winning number) and continues until: - The user successfully guesses the winning number, or - The user tries all his/her attempts to guess the winning number with no luck. - Here's a snippet to the console screen after execution: Guess the winning number [100, 1000]: 500 500 is not the winning number. Guess a number smaller than 500:250 250 is not the winning number. Guess a number greater than 250: 400 400 is not the winning number. Guess a number greater than 400:450 450 is not the winning number. Guess a number smaller than 450:425 425 is not the winning number. Guess a number greater than 425:440 440 is not the winning number. Guess a number smaller than 440:430 430 is not the winning number. Guess a number greater than 430:435 Congratulations, you won... You guessed the winning number after 8 attemptsi - Here's another snippet to the console screen after execution: Guess the winning number [100, 1000]: 440 440 is not the winning number. Guess a number greater than 440:450 450 is not the winning number. Guess a number greater than 450:460 460 is not the winning number. Guess a number greater than 460:470 470 is not the winning number. Guess a number greater than 470:470 470 is not the winning number. Guess a number greater than 470:490 490 is not the winning number. Guess a number greater than 490:500 500 is not the winning number. Guess a number greater than 500:510 510 is not the winning number. Guess a number greater than 510: 520 520 is not the winning number. Guess a number greater than 520:530 530 is not the winning number. Guess a number greater than 530: 540 501ry, you lost. The winning number was 887 - Your program SHOULD contain appropriate comments, both documentation and implementation comments. - For iterative constructs, your program SHOULD ONLY use while statement

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

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

9th Edition

B01JXPZ7AK, 9780805360479

More Books

Students also viewed these Databases questions

Question

1. Prepare a short profile of Mikhail Zoshchenko ?

Answered: 1 week ago

Question

What is psychology disorder?

Answered: 1 week ago