In
this activity we will ask the user a question, and give 3
possible choices for answers.
Create
a new slide show. The first slide should have a greeting
message and collect the user's name. Store it in a variable
called userName.
We are going to ask our user a simple Maths question.
We will have two message boxes that say either ‘Well Done’ or ‘Try Again’
First we’ll make a procedure to pop up our Well Done message box
Sub WellDone()
MsgBox ("Well Done " &
userName)
End Sub
|
Now make another procedure below it for when the user gets the question wrong.
Sub BadLuck()
MsgBox ("Bad Luck " & userName
& ". Try again!")
End Sub
|
Now all we have to do is put our question on Slide 2.
Type ‘What is 1+1?’ at the top of the slide
- Make an action button:
- Attach the macro WellDone to it and add the number 2 to the button text
- Make 2 more action buttons:
- Attach the macro BadLuck to each of them and add incorrect
answers to the button text
Now try it out.
|