« All Events
3 PM – Intro To Java
December 18, 2021 @ 3:00 pm - 4:00 pm
Today We Do:
- We learned about while loop
- We learned about Random number.
Homework:
- Our coding school closes from Dec 24 to Jan 2. The class will resume on Jan 8.
- Create guess a number between 0 to 100. The game give you exercise to use Random number generator. while loop (forever loop), if else statements, get input from shell.
- Every time you start the game, it will generate a secretNumber, which is a number between 0 to 100.
- Below is how the game is going to look like
-
Welcome to AYCLOGIC Guess a number game!!
Please guess a number between 0 to 100
Guess a number: 50
Your guess is too high. Please try a smaller number.
Guess a number: 25
Your guess is too low. Please try a bigger number.
Guess a number: 32
Your guess is too low. Please try a bigger number.
Guess a number: 42
Your guess is too high. Please try a smaller number.
Guess a number: 38
Your guess is too low. Please try a bigger number.
Guess a number: 40
Your guess is too low. Please try a bigger number.
Guess a number: 41
Congratulation you guessed correctly, the answer is 41