Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim age As Integer
age = Integer.Parse(TextBox1.Text)
MessageBox.Show("You may be happy ... I hope you are :-)")
MessageBox.Show("You may also smile :-)")
If age >= 18 Then
MessageBox.Show("You may vote.") ' ages 18 and up
MessageBox.Show("Please use your voting privileges wisely!") ' ages 18 and up
If age >= 30 Then
MessageBox.Show("It's nice to see that the geezers are getting out to vote too.") ' ages 30 and up
Else
MessageBox.Show("I know you're new at this, make us proud.") ' ages 18 through 29
End If
Else
MessageBox.Show("You may ride the sooper dooper scooper ride.") ' ages 17 and below
If age <= 10 Then
MessageBox.Show("You can pay the childrens price for admission") ' ages 10 and below
End If
End If
MessageBox.Show("You may eat ice cream.") ' All ages
MessageBox.Show("Enjoy!") ' All ages
End Sub
End Class