Question: Create a program that will randomly pick an integer less than 100 (do NOT tell the user what number is picked!) You will need the
int number = r.nextInt(100); //number is now a random int less than 100
Give the user 10 guesses to see if they can pick the right number.
FOR MAX 2 MARKS you should
- Ask the user a maximum of 10 times.
- If they guess the correct number, output "You win"
- If they run out of chances, output "Hard luck!".
Step by Step Solution
3.45 Rating (155 Votes )
There are 3 Steps involved in it
public static void mainString args Random r new Random int number ... View full answer
Get step-by-step solutions from verified subject matter experts
