Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub cmdStart_Click()
- Dim pupilname(1 To 6) As String
- Dim age(1 To 6) As Integer
- Dim gender(1 To 6) As String
- Dim index As Integer
- Dim randomnuber As Integer
- For index = 1 To 6
- pupilname(index) = InputBox("enter name of pupil " & index)
- age(index) = InputBox("enter age of pupil " & index)
- Do While age(index) < 11 Or age(index) > 18
- MsgBox ("this is not a valid age")
- age(index) = InputBox("invalid age - 11 to 18 inclusive")
- Loop
- gender(index) = InputBox("enter age of (pupil " & index)
- Do While gender(index) <> "F" & gender(index) <> "M"
- MsgBox ("this is not VALID GENDER")
- gender(index) = InputBox("invalid gender 'M' or 'F'")
- Loop
- Next index
- End Sub
- Private Sub Form_Load()
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement