For those that are struggling for homework, here is a program that calculates the longest tails run and longest heads run. Easily modified for whatever your requirements for your homework.
rem this program prints the longest tails run and heads run in a 100 coin toss
rem set up a dimensional array to store 100 coin tosses
dim results[100]
rem sets up maxheads to 0, this will store the longest run of heads
maxheads=0
rem sets up maxtails to 0, this will store the longest run of tails
maxtails=0
rem this for loop does the coin toss 100 times
for cointoss=1 to 100
rem this makes the computer pick a random number from 0 to 1, where 1 is heads and 0 is tails
results[cointoss]=random(0,1)
rem if the cointoss=heads then increment the headsrun
if results[cointoss]=1 then inc headsrun
rem if the headsrun is greater than maxheads then let maxheads equal to the headsrun
if headsrun>maxheads then maxheads=headsrun
rem if cointoss=tails then stop the headsrun and set headsrun to zero and increment the tailsrun
if results[cointoss]=0
inc tailsrun
headsrun=0
endif
rem if the tailsrun is greater than the maxtails then maxtails is made equal to the tailsrun
if tailsrun>maxtails then maxtails=tailsrun
rem if the cointoss=heads then sets the tailsrun to zero
if results[cointoss]=1 then tailsrun=0
next cointoss
rem counts the results
print("longest heads run")
printc(maxheads)
print(" ")
print("longest tails run")
printc(maxtails)
sync()
do
loop
DBPro is the new Amos (I hope)