Answered step by step
Verified Expert Solution
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
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started