Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.image text in transcribed

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

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

Database Processing

Authors: David M. Kroenke

12th Edition International Edition

1292023422, 978-1292023427

More Books

Students also viewed these Databases questions