Description
Write a program that:
-‐ asks for user input to specify a lower and an upper boundary for picking a random integer
-‐ picks a random integer in the specified range
-‐ asks user to guess the random value
-‐ prints for each guess if the it is higher or lower than the randomly picked value
-‐ when the user makes a guess that matches the random value, prints the following information:
o the number of guesses made to find the value o the minimum of all guesses o the maximum of all guesses o the average of all guesses
Your program should provide an output like the following examples:
Hints:
i) You can use the Math library or implement your own methods for finding maximum and minimum of two given values.
ii) You can use readInt to ask integer input from the user. iii) You can use rgen.nextInt to pick an integer randomly
Reviews
There are no reviews yet.