Question: 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

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.

How do I fix this?

Suppose you are writing a game-playing program that involves 2-digit numbers. First,

import java.util.Scanner; import java.util. Random; public class Guess{ public static void main(String[] args) { //print output System.out.println("Try to guess my secret two-digit number, and I'll tell you how " + "many digits from your guess appear in my number."); Scanner input = new Scanner(System.in); int flag=1, rem1, rem2, divide1, divide2; Random ran = new Random(); int ran_inti = ran.nextInt(100)+10; for(int i=1;i

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!