Java Bootcamp – Workbooks and Challenges
)}

Workbook 5.8

From the Java Bootcamp Resources, launch Workbook 5.8.

8.png

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!

Visualizing the Runtime

After you solve this workbook, I still recommend watching the video solution on Udemy.

8.png

It will show you how to visualize the runtime using Visual Studio Code.


Associated Course: The Complete Java Development Bootcamp
Related Course: The Complete Spring Boot Development Bootcamp – Become a Java Web Developer

Feedback Summary
4.7
43 students
5

91%
4

2%
3

0%
2

0%
1

7%
Written Reviews
There are no written reviews yet.