Reference no: EM132216451
Question :
1. Write a sub procedure that plays a simple number guessing game in five rounds of play. Your program chooses the number to be guessed by selecting an integer at random in the range [1-100]. Your sub procedure must organize the output as a table with the round number, value of each guess, and the status of each guess as "Too High", "Too Low", or "Correct!" You must also meet the following requirements:
a. The sub procedure should be named number Guess.
b. You must use a single input box to request each guess of the player. In the input box, you must display the prompt "I have a number between 1 and 100 -- can you guess my number? The input box must also inform the player of the round number and the number of guesses remaining in the game.
c. Your program must verify the guess input by the player to ensure it can represent an integer number in the correct range (1 - 100). If the player does not enter a valid guess, the input box must continue to request an integer in the range using a message box until the player provides valid data. This same functionality must be provided if the player presses the "OK" button on the input box without providing an input or if the player presses the "Cancel" button on the input box.
d. The color of each cell for the guess in the table (after the first) should be changed to red to indicate the player is getting "warmer", blue to indicate the player is getting "colder", or green to indicate a correct guess. This functionality must be implemented with the use of the of f set property and selection statements.
e. A message box should alert the player of a game over and reveal the answer if no correct guess is made in five rounds or if a correct guess is made. Also, the game should not continue if a correct guess is made.
Assign the sub procedure Number Guess to a rectangular shape button. The caption of the rectangular shape button should Egad "Guess the Number?"
2. Write a sub procedure named Reset, Game that will clear the output table. Assign the sub procedure Reset .Game to a rectangular shape button. The caption of the rectangular shape button should read " Read".