|
|
 |
Private Sub
Sub frmquiz_Load(ByVal sender As system.object, ByVal e As System.EventArgs) Handles Mybase.Load
Dim name As String
name = InputBox("What is your name?", "Enter your Name.", , 1, 1)
lblName.Text = name
End Sub
Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnStart.click
btnStart.Enabled = False
Dim q1 As String
Dim q2 As String
Dim q3 As String
Dim q4 As String
Dim q5 As String
Dim q6 As String
Dim correct As Integer
q1 = InputBox("South Lakes located in reston. T/F", "Question 1")
If q1 = "T" Then correct = correct + 1
q2 = InputBox("The Cross Country will win this weekend. T/F", "Question 2")
If q2 = "T" Then correct = correct + 1
q3 = InputBox("Tim Tebow is a beast. T/F", "Question 3")
If q3 = "T" Then correct = correct + 1
q4 = InputBox("House is the name of an ABC TV show. T/F", "Question 4")
If q4 = "F" Then correct = correct + 1
q5 = InputBox("Jalal is on the footbal team. T/F", "Question 5")
If q5 = "F" Then correct = correct + 1
q6 = InputBox("It's great to be a seahawk. T/F", "Question 6")
If q6 = "T" Then correct = correct + 1
btnagain.Enabled = True
btnQuit.Enabled = True
MessageBox.Show((correct / 6) * 100, "percentage correct", MessageBoxButtons.OK,
MessageBoxIcon.Information)
Me.lblCorrect.Text = (correct / 6) * 100
End Sub |
|
 |
|
|
|
|