I been working with DBP for a total of two weeks now. I got your program to work. DBP, must be easy to learn.
Compare your code to mine. You made the same mistake I made, forgot to wait at the end of your code. It was printing your answers, but then would close so fast you couldn't see them.
I have spent so much time watching tutorials and reading books the last two weeks, I think I will go insane trying to grasp programing!
Hope this helps!
[/code]
print "How hard did you throw it? (Please type an integer)"
input "", Vo#
wait 500
cls
print "At what angle did you throw it? (Please type and integer)"
input "", Theta#
wait 500
gosub Calc
cls
print "seconds to reach the top of its trajectory. ";toptime#;" "
print "The projectile reached a height of ";height#;" feet."
Print "Total time traveled is ";totalTime#;" seconds."
print "You threw it ";distanceAway#;" feet."
wait key
end
Calc:
Vox# = Vo# * COS(Theta#)
Voy# = Vo# * SIN(Theta#)
topTime# = (0.0 - Vo#) / (-9.8)
height# = (Vo#) * (topTime#) + (0.5) * (-9.8)*(topTime#)
totalTime# = topTime# * 2
distanceAway# = Vox# * topTime#
Return
[code]
some cool stuff someone else said here