Question: Revise the High-Low Game solution so that at the end of the game it displays an additional message telling the user how many guesses he
Revise the High-Low Game solution so that at the end of the game it displays an additional message telling the user how many guesses he or she made. As a result, the program output on pages 11-13 of this document would have an additional output dialog box after the You guessed the secret number dialog box.
High-Low Game VBA Code:
Sub HigherLowerGame()
Dim secret As Integer
Dim guess As Integer
secret = WorksheetFunction.RandBetween(1, 1000)
Do
guess = InputBox("Please enter your guess")
If secret > guess Then
MsgBox "Higher"
ElseIf secret < guess Then
MsgBox "Lower"
Else
MsgBox "You guessed the secret number"
End If
Loop While guess <> secret
End Sub
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
