Question: ESI 4 3 5 6 SPREADSHEET - BASED DECISION SUPPORT SYSTEMS EXERCISE Guessing Game Problem In this problem, you will be implementing a simple guessing

ESI4356 SPREADSHEET-BASED DECISION SUPPORT SYSTEMS
EXERCISE Guessing Game
Problem
In this problem, you will be implementing a simple guessing game. The worksheet is shown below:
When the user clicks the Start button, the table is cleared, the button is removed, and the game generates a random integer between the lower and upper bounds (input by the user). The game then displays an InputBox prompting the user for a guess.
After each guess, the game waits 1 second before populating the table with the users guess and whether the actual number is lesser or greater than the guess. If the actual number is greater than the guess, the background color of the response should be Green (vbGreen); if the actual number is smaller than the guess, the background color of the response should be Red (vbRed); if the guess matches the actual number, then the background color should be Cyan (vbCyan).
A sample run of the game is displayed below.
User inputs 50; actual number is greater.
User inputs 75 and 70; actual number is smaller than both guesses.
User clicks OK without entering a value or enters a non-numeric value, a message box appears.
User continues to input guesses. Once the user guesses 53, the game stops, and a new Start button appears.
If the user guesses incorrectly 10 times, a messagebox will appear informing that the user has lost.
You will need to implement the following macros. Your macros will need to do everything described in the comments.
The function StrPtr() can be used to read the inputbox output as a user selection of Cancel, where StrPtr(inputbox_value)=0 in the case of Cancel.
Create a separate macro/subroutine that re-creates the Start button.
The buttons left position, top position, width and height are 315,80,100, and 25, respectively. To add the Start text to a shape, use the following line of code.
btnShape.TextFrame2.TextRange.Characters.Text = "Start"
To assign the GuessGame macro to a shape, use the following line of code.
btnShape.OnAction = "GuessGame"

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!