'*************************************************************** '* Name: CS 100-01 * '* Program Name: Can You Vote? * '* Date: 2/06/03 * '* Description: This program is designed to accept an integer * '* that represents the user's age. The age is checked to * '* see if the user is eligible to vote. * '*************************************************************** Private Sub cmdExit_Click() End End Sub Private Sub cmdVote_Click() Dim intAge As Integer 'Dim ageText As String Dim strCitizen As String picVote.Cls 'ageText = Left(txtAge, 1) 'If (ageText >= "0") And (ageText <= "9") Then If (IsNumeric(txtAge.Text)) Then intAge = Val(txtAge.Text) If (intAge >= 18) Then strCitizen = InputBox("Are you a US citizen?", "US Citizen?", "Y") strCitizen = UCase(strCitizen) If (strCitizen = "Y") Then picVote.Print "You are able to vote!" Else If (strCitizen = "N") Then picVote.Print "You are not able to vote!" Else MsgBox "Please enter Y or N!", , "Error Message" End If End If Else picVote.Print "You are not able to vote!" End If Else picVote.Print "Only enter a number please!" End If End Sub