dim fr as integer
dim fe as integer
dim ama as integer
dim ima as integer
dim eff as integer
dim choice as integer
print "What Simple Machine do you want to calculate MA for?"
print "1. Inclined Plane"
input "Choice: " , choice
if choice = 1 then
dim L as integer
dim H as integer
input "What is the Length of the ramp? " , L
input "What is the Height of the ramp? " , H
input "What is Fr? " , fr
input "What is Fe? " , fe
ima=L/H
ama=fr/fe
eff=(ama/ima)*100
cls
print "Results"
print "IMA: " ; ima ; ":1"
print "AMA: " ; ama ; ":1"
print "Efficiency: " ; eff ; "%"
sleep
endif
sleep
Integers are "whole numbers" only, if you want decimals you'll have to use floats:
Single (precision) 32 bit, or Double (precision) 64 bit.
See: Wikipedia for detailed info.
dim as single fr, fe, ama, ima, eff, choice
print "What Simple Machine do you want to calculate MA for?"
print "1. Inclined Plane"
input "Choice: " , choice
if choice = 1 then
dim L as integer
dim H as integer
input "What is the Length of the ramp? " , L
input "What is the Height of the ramp? " , H
input "What is Fr? " , fr
input "What is Fe? " , fe
ima=L/H
ama=fr/fe
eff=(ama/ima)*100
cls
print "Results"
print "IMA: " ; ima ; ":1"
print "AMA: " ; ama ; ":1"
print "Efficiency: " ; eff ; "%"
sleep
endif
sleep
Be sure to also check the Documentation forum. You'll find invaluable information there, including a PDF manual to help you get started with FreeBasic.