Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

49 System.out.println( What is + number3 + + number4 + ?); 59 int answer2 = input.nextInt(); 51 i=0; 52 while (number 3 - number4 !=

image text in transcribed
image text in transcribed
49 System.out.println(" What is + number3 + + number4 + "?"); 59 int answer2 = input.nextInt(); 51 i=0; 52 while (number 3 - number4 != answer2) { 53 System.out.println(" Wrong Answer. Try again. What is + number + + number4 54 answer2 = input.nextInt(); 55 i= i + 1; 56 } 57 System.out.println(" You got it! Congratulations"); 58 System.out.println(" Number of times you have tried is + i); 59 // 60 // Guessing a number 61 !! Program will let you try infinite number of times and will give you number of tries. 62 i-; 63 int number (int) (Math.random()*101); 64 System.out.println(" Guess a magic number between 0 and 100 "); 65 int guess = -1; 66 while (guess != number5) { 68 System.out.println(" Enter your guessin "); 69 guess = input.nextInt(); 70 if (guess == number5); 71 System.out.println(" Yes the number is + number5); else if (guess > number 5) 73 System.out.println(" Your guess is too high "); 74 else 75 System.out.println(" Your guess is too low "); 76 i = 1:1; 77 ) 78 System.out.println(" Number of times you have tried is " + i); 67 72 What is the error at Line 72

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

Step: 3

blur-text-image

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

Modern Database Management

Authors: Heikki Topi, Jeffrey A Hoffer, Ramesh Venkataraman

13th Edition

0134773659, 978-0134773650

More Books

Students also viewed these Databases questions