Shane Partridge
Visual Basic 2013
The Code
Public Class Form21
Dim a, b As Integer
Dim Answer As Single
Dim TT As Integer
Dim R As Integer
Dim p1 As Integer
Dim P2 As Integer
Dim CycleCount As Integer
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Form17.Show()
Me.Hide()
End Sub
Private Sub Bnt3TestValue_Click(sender As Object, e As EventArgs) Handles Button3.Click
Answer = Answer.Text
If TT = Answer Then
TestValue.Text = "Correct" : p1 = (p1 + 1) : CorrectCount.Text = p1
ElseIf TT <> Answer Then
TestValue.Text = "Incorrect" : P2 = (P2 + 1) : IncorrectCount.Text = P2
End If
CycleCount = (CycleCount + 1)
Label7.Text = CycleCount
End Sub
Private Sub Btn1Random_Click(sender As Object, e As EventArgs) Handles Button1.Click
R = RandomValue.Text
a = (R * Rnd() + 1)
b = (R * Rnd() + 1)
TT = (a + b)
Value1.Text = a
Value2.Text = b
End Sub
Private Sub Btn4Clear_Click(sender As Object, e As EventArgs) Handles Button4.Click
RandomValue.Text = ""
Answer.Text = ""
Value1.Text = ""
Value2.Text = ""
TestValue.Text = ""
CorrectCount.Text = ""
IncorrectCount.Text = ""
End Sub
End Class