Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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?

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Case Studies In Business Data Bases

Authors: James Bradley

1st Edition

0030141346, 978-0030141348

More Books

Students also viewed these Databases questions

Question

Determining how many people will lose their jobs.

Answered: 1 week ago

Question

Write down the circumstances in which you led.

Answered: 1 week ago