Student Project

GUESSING GAME 1
Ability Level: Beginner
Estimated Time: 1 hour
Objectives: Understand and use global variables
Materials and Resources:
  • Visual Basic Software
  • Textbook
Overview:
  • The object of this project is to write a computer program that will allow the computer to guess a number that you have selected. The computer will make a guess and you, the player, will tell the computer if it guessed too high, too low, or that it guessed the number.
  • The program will also allow the player to start a new game or to exit the program.
Instructions:
  1. Create a form with a labeled box to display the guess by the computer.
  2. Create a new game and an exit button.
  3. Create objects to indicate if the guess was too high, too low, or right on target.
  4. Create program code to respond to the players indication by selecting and displaying a new computer guess.
  5. When the computer guesses the players number, reset the computer so that a new game may begin.
Hints: This solution uses buttons to indicate the success of the guess by the computer. The new game button will reset the guess to 50 and set any counters back to zero.



PROJECT EXTRAS
  • Display the number of guesses the computer required to find the players number.
  • Declare victory automatically when the last possible guess is made.
  • Keep and report counts of how many guesses were too high and too low.