Question: Java program, please. 1. Task: Suppose you are writing a game-playing program that involves 2-digit numbers. First, generate a random 2-digit number. The user will

Java program, please.Java program, please. 1. Task: Suppose you are writing a game-playing program

1. Task: Suppose you are writing a game-playing program that involves 2-digit numbers. First, generate a random 2-digit number. The user will try to guess this number in at most 10 attempts. While getting input from the user give a hint if a match was found (0/1/2 digits match). Test for errors in input (including type check). Use the sample output to fully understand the program requirements. SAMPLE OUTPUT: Try to guess my secret two-digit number, and I'll tell you how many digits from your guess appear in my number. Be smart! You can try at most 10 times. Your guess: 33 Incorrect (hint: 0 digits match) Your guess: gbh; Not an integer! Try again: Your guess: 11 Incorrect (hint: 0 digits match) Your guess: 9.6 Not an integer! Try again: Your guess: 34 Incorrect (hint: 0 digits match) Your guess: 26 Incorrect (hint: 1 digits match) Your guess: 28 Incorrect (hint: 1 digits match) Your guess: 12 Incorrect (hint: 1 digits match) Your guess: f Not an integer! Try again: Your guess: 27 Incorrect (hint: 1 digits match) Your guess: 29 Incorrect (hint: 2 digits match) Your guess: 92 You guessed my number in 9 tries

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!