View.Set ("graphics")
View.Set ("title:Acceleration Calculator - JamesXm")
var a, v1, v2, v, t : real
var whattofind : string
procedure finda
v := v2 - v1
a := v div t
put "Step One:"
put ""
put v2, "-", v1
put "divided by"
put t
put ""
put "Step Two:"
put ""
put v
put "divided by"
put t
put ""
put "Step Three:"
put ""
put a
put ""
put ""
put "Therefore, the acceleration is " ,a:2
end finda
procedure findv1
end findv1
procedure findv2
end findv2
procedure findt
end findt
put "What are you trying to find? (enter a, b, c, or d)"
put "a) Acceleration (m/s2)"
put "b) Initial Speed (m/s)"
put "c) Final Speed (m/s)"
put "d) Time (s)"
get whattofind
cls
if whattofind = "a" then
put "Initial Speed (m/s):"
get v1
put "Final Speed (m/s):"
get v2
put "Time (s):"
get t
cls
finda
elsif whattofind = "b" then
put "Acceleration (m/s2):"
get a
put "Final Speed (m/s):"
get v2
put "Time (s):"
get t
cls
findv1
elsif whattofind = "c" then
put "Acceleration (m/s2):"
get a
put "Initial Speed (m/s):"
get v1
put "Time (s):"
get t
cls
findv2
elsif whattofind = "d" then
put "Acceleration (m/s2):"
get a
put "Initial Speed (m/s):"
get v1
put "Final Speed (m/s):"
get v2
cls
findt
else
put "Restart the program! An error has occured."
end if
|