Question: please.solve my java question Problem #2: (20 pts) Write a java program that generates a random integer between 0 and 9. The program then gives

please.solve my java question
Problem #2: (20 pts) Write a java program that generates a random integer between 0 and 9. The program then gives the user 3 chances to guess it. If the user guesses the number, the program prints the message "Congratulations!". If the user doesn't guess the number after three attempts, the program displays "Bad luck!" Sample run 1: I'm thinking about a number in 10, 91. Can you guess it? (attempt #1): 5 I'm thinking about a number in [0, 9). Can you guess it? (attempt #2): 3 I'm thinking about a number in [0, 9). Can you guess it? (attempt #3): 8 Bad luck! The correct number is 1. Sample run 2: I'm thinking about a number in [0, 9). Can you guess it? (attempt #1): 5 Congratulations! The correct number is 5
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
