Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Form1
- Private Sub BT_Exec_Click(sender As Object, e As EventArgs) Handles BT_Exec.Click
- Dim Aufgabenzahl, Zahl1, Zahl2, Ergebnis, i, punkt As Byte
- Randomize()
- Aufgabenzahl = TextBox1.Text
- Do While i <= Aufgabenzahl
- i = i + 1
- Zahl1 = Int((10 - 1 + 1) * Rnd() + 1)
- Zahl2 = Int((10 - 1 + 1) * Rnd() + 1)
- Ergebnis = InputBox("Was ist " & Zahl1 & "*" & Zahl2 & "?")
- i = i + 1
- If Ergebnis = Zahl1 * Zahl2 Then
- Label2.Text = "Richtig!"
- punkt = punkt + 1
- Else
- Label2.Text = "Nope, not at all."
- End If
- Loop
- If punkt = Aufgabenzahl Then
- Label2.Text = "GJ."
- End If
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement