Java !! Overview In this task, you should start from the images GuessTheNumber.java output. The purpose is i.a. to learn how to use different control flow constructions and how we create random numbers within certain intervals by using the Math class. Task Based on the images GuessTheNumber output and extend its functionality as below: • The program should ask the user within which interval the random numbers should be. I.e. the program should ask for the minimum value and the maximum value the random number can be between (inclusive). It is ok to assume that no negative numbers are used and that the user first writes the lowest and then the highest. • If the user guesses a number that is outside the range, the program will print the valid range. • If the user guesses incorrectly, but within the range, the program should print if the guessed value is higher or lower than the hidden number. • If the user guesses correctly, the program should print out how many guesses were required. • If the user writes "exit" as his guess, the program must end. See the section Tips for task 2 regarding comparison of strings. Example run 1, 2 attached with the question

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Java !!

Overview
In this task, you should start from the images GuessTheNumber.java output. The purpose is i.a. to learn how to use different control flow constructions and how we create random numbers within certain intervals by using the Math class.
Task
Based on the images GuessTheNumber output and extend its functionality as below:
• The program should ask the user within which interval the random numbers should be. I.e. the program should ask for the minimum value and the maximum value the random number can be between (inclusive). It is ok to assume that no negative numbers are used and that the user first writes the lowest and then the highest.
• If the user guesses a number that is outside the range, the program will print the valid range.
• If the user guesses incorrectly, but within the range, the program should print if the guessed value is higher or lower than the hidden number.
• If the user guesses correctly, the program should print out how many guesses were required.
• If the user writes "exit" as his guess, the program must end. See the section Tips for task 2 regarding comparison of strings.
Example run 1, 2 attached with the question

Enter min value: 0
Enter max value: 10
Guess what number I'm thinking of...
Your guess> 9
Too high
Your guess> 1
Too low
Your guess> 7
Correct! It took you 3 guesses.
Transcribed Image Text:Enter min value: 0 Enter max value: 10 Guess what number I'm thinking of... Your guess> 9 Too high Your guess> 1 Too low Your guess> 7 Correct! It took you 3 guesses.
Enter min value: 500
Enter max value: 100000
Guess what number I'm thinking of...
Your guess> 499
I'm thinking of a number between 500 and 100000
Your guess> 100001
I'm thinking of a number between 500 and 100000
Your guess> exit
Good bye!
Transcribed Image Text:Enter min value: 500 Enter max value: 100000 Guess what number I'm thinking of... Your guess> 499 I'm thinking of a number between 500 and 100000 Your guess> 100001 I'm thinking of a number between 500 and 100000 Your guess> exit Good bye!
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY