Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

What would I need to do in order for my code to print out too low or too high if the number is wrong, and

What would I need to do in order for my code to print out too low or too high if the number is wrong, and then adjust the range if its too high or too low
image text in transcribed
image text in transcribed
As well as, having 5 max tries, and if number is not guessed end program
Proje package com.company import java.util.Scanner; class scratch { //ClassName public static void main(String[] args) { Scanner input = new Scanner(System.in); int pax, min, guess, secret, maxAttempts = 5; System.out.println("What would be the low range: "); min = 'input.nextInt(); Systen.out.println("high range: "); max = input.nextInt(); System.out.println("Please pick a "number between " + minit "-" + max); guess = input.nextInt(); System.out.printin("Your guess-'is: guess); secret = (int) (Math.random() * (max - min + 1) + min); 26 If What would be the low range: 10 high range: 5.100. Please pick a number between 10-100 :50 Your guess is: 50 Process finished with exit code 0

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

Probabilistic Databases

Authors: Dan Suciu, Dan Olteanu, Christopher Re, Christoph Koch

1st Edition

3031007514, 978-3031007514

More Books

Students also viewed these Databases questions

Question

ethical and moral values in reciprocal relationships;

Answered: 1 week ago