Pseudo Code
On button “shake”
click
Generate random number between 1-5
If the random number=1
Display
“Not sure” in label answer
If random number=2
Display
“Ok” in label “answer”
If random number=3
Display
“Yes” in label “answer”
If random number=4
Display
“No” in label “answer”
If random number=5
Display
“Maybe” in label “answer”
Pseudo code is a description on the key aspects of the program. I have chosen to display the "Shake!" button properties (the "yes" "no" and "maybe" answers).
Program Code:
Public Class frmMagic
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
End
End Sub
Private Sub btnShake_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShake.Click
Dim intRandom As Integer
intRandom = Int(Rnd() * 3 + 1)
Select Case intRandom
Case "1"
lblAnswer.Text = "yea cunt"
Case "2"
lblAnswer.Text = "no"
Case "3"
lblAnswer.Text = "maybe"
Case Else
lblAnswer.Text = "ERROR"
End Select
End Sub
End Class
Pseudo code is a description on the key aspects of the program. I have chosen to display the "Shake!" button properties (the "yes" "no" and "maybe" answers).
Program Code:
Public Class frmMagic
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
End
End Sub
Private Sub btnShake_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShake.Click
Dim intRandom As Integer
intRandom = Int(Rnd() * 3 + 1)
Select Case intRandom
Case "1"
lblAnswer.Text = "yea cunt"
Case "2"
lblAnswer.Text = "no"
Case "3"
lblAnswer.Text = "maybe"
Case Else
lblAnswer.Text = "ERROR"
End Select
End Sub
End Class
No comments:
Post a Comment