Advertisement
Guest User

Untitled

a guest
Feb 27th, 2015
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. Public Class Form1
  2.  
  3. Private Sub BT_Exec_Click(sender As Object, e As EventArgs) Handles BT_Exec.Click
  4. Dim Aufgabenzahl, Zahl1, Zahl2, Ergebnis, i, punkt As Byte
  5. Randomize()
  6. Aufgabenzahl = TextBox1.Text
  7. Do While i <= Aufgabenzahl
  8. i = i + 1
  9. Zahl1 = Int((10 - 1 + 1) * Rnd() + 1)
  10. Zahl2 = Int((10 - 1 + 1) * Rnd() + 1)
  11. Ergebnis = InputBox("Was ist " & Zahl1 & "*" & Zahl2 & "?")
  12. i = i + 1
  13. If Ergebnis = Zahl1 * Zahl2 Then
  14. Label2.Text = "Richtig!"
  15. punkt = punkt + 1
  16. Else
  17. Label2.Text = "Nope, not at all."
  18. End If
  19. Loop
  20. If punkt = Aufgabenzahl Then
  21. Label2.Text = "GJ."
  22. End If
  23.  
  24. End Sub
  25. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement