Java Bootcamp – Workbooks and Challenges
)}

Workbook 5.8

From Java Bootcamp Resources -> Module 1 -> 5. Loops, open Workbook 5.8.

Guess the number

In this workbook, the user has to keep guessing a number until they get it right.

Task 1

Store a "secret" number between 1 and 5. Then, prompt the user to enter a guess.

Task 2

Set up a loop that keeps the user guessing until they get it right.

In other words, the loop should keep running while the guess is different from the secret.

Task 3

After they guess the number, print:

You got it!

Good Luck!

Feedback Summary
4.8
39 students
5

92%
4

3%
3

0%
2

0%
1

5%
Written Reviews
There are no written reviews yet.