I am very new to visual basic. My homework assignment is to make a form functional that my teacher set up. The for is a coin toss program that has a text box for heads and tails that will be filled with the head and tails count (the amount it lands on either) The percentage of times it lands on either and the longest run that a head or tail is consecutively landed on. We have a text box the user inserts the amount of flips they want. there are two buttons; one of them just flips the coin as many times as the user inserts and the other button flips the coin until the consecutive flips of either heads or tails is reached from the user inserted amount. I have no clue what to do with the code. How do I do this?!
I have gone to class every single day. The teacher just learned Visual Basic this summer and is not much help. There is no text for this book so I am trying to get HELP any way I can. I am not trying to cheat (although I understand it may seem like that and maybe it even is cheating) I am just really lost and seeing if anyone can give me a hand. I have been working on this problem for a week straight.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim rnd As New Random
Dim num As Integer
Dim headcount As Double
Dim tailcount As Double
Dim target As Double
For i = 0 To target
num = rnd.Next(0, 2)
headcount = 0
tailcount = 0
If num = 1 Then
headcount += (headcount + 1)
Else
tailcount += (tailcount + 1)
End If
Bookmarks