
Ross Sheppard High School
Computer Programming 20
Student Learning Guide
Answer to Pseudo-code Test Your Knowledge
Original Code for Visual Basic:
Private Sub btnExit_Click()
Dim Response As Integer
'Unloads this form after asking if the user is sure
Response = MsgBox("Are you sure you want to quit the Calculator Program?", vbQuestion + vbYesNo,
"Quit Calculator?")
If Response = vbYes Then
Unload Me
End If
End Sub
Pseudo-code:
Private Sub btnExit_Click()
When user clicks exit
Confirm selection
If response is yes then
unload form and exit program
Else return to program
End If
End Sub