| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • Whenever you search in PBworks, Dokkio Sidebar (from the makers of PBworks) will run the same search in your Drive, Dropbox, OneDrive, Gmail, and Slack. Now you can find what you're looking for wherever it lives. Try Dokkio Sidebar for free.

View
 

Guess the Number

Page history last edited by Mike Leishman 12 years, 5 months ago

Guess the Number

Challenge #2

 

Write a guessing game computer program. It must ask the user to guess a secret number between 1 and 100 and continue until the secret number is guessed. If the user guesses the wrong number, display a message stating that they are too high or too low such as "Bad Guess – Too High - Try again". Make your program count the number of guesses taken. When the user guesses the correct number, display the Message "You guessed it in <number of guesses> guesses" and stop the program.
 
Extension: You can also provide the user with other information such as “cold”, “warm” and “hot” depending on how far out their guess is.
 

Teacher submissions 

  
 
 
 
 
 
 
 
(add a new link and paste your code on the new page)
 

Student submissions

 

Please make these on behalf of your students - do not give them the password.

 

Comments (0)

You don't have permission to comment on this page.