Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Outcomes: 1. To develop skills in using the Java selection constructs (if, and if else). 2. Use the Java iteration constructs (while, do, for). 3.

image text in transcribed

image text in transcribed

image text in transcribed

Outcomes: 1. To develop skills in using the Java selection constructs (if, and if else). 2. Use the Java iteration constructs (while, do, for). 3. Use Boolean variables and expressions to control iterations. 4. Random number generation. 5. Proper Design techniques including reading UML Class Diagrams Requirements: 1) Develop a simple class that represents a number guessing game. The game is played by the program randomly generating a number and the user attempting to guess that number. After each guess the program will provide a hint to the user identifying the relationship between the number and the guess. If the guess is above the answer then "Too High" is returned, if the guess is below the answer then"Too Low". Also if the difference between the answer and the guess is less than the difference between the answer and the previous guess, "Getting warmer" is returned. If the difference between the answer and the guess is more than the difference between the answer and the previous guess, then "Getting Colder" is returned. GuessingGame MAXGUESSESALLOWED: int answer: int generator : Random gameOver : boolean differential : int max int numGuessesTaken:int GuessingGame) GuessingGame (int) newGame(int) guess(int): String isGameOver): boolean The program will allow the user to play multiple games. Once a game is complete the user will be prompted to play a new game or quit. 2) 3) Design and build a GuessingGame class. a. One constant i. MAXGUESSESALLOWED ii. an int that represents the maximum number of guesses the user gets, once this value is passed the game is over. (set to 6)

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

Oracle Autonomous Database In Enterprise Architecture

Authors: Bal Mukund Sharma, Krishnakumar KM, Rashmi Panda

1st Edition

1801072248, 978-1801072243

More Books

Students also viewed these Databases questions