# calculate distance travelled by body. (function)
DECLARE FUNCTION DIS (u,t,a)
CLS
INPUT"Enter initial velocity";u
INPUT"Enter Time";t
INPUT"Enter Acceleration ";a
PRINT" Distance travelled =";DIS(u,t,a)
END
FUNCTION DIS (u, t, a)
S=u*t+1/2*a*t^2
DIS=S
END FUNCTION
DECLARE FUNCTION DIS (u,t,a)
CLS
INPUT"Enter initial velocity";u
INPUT"Enter Time";t
INPUT"Enter Acceleration ";a
PRINT" Distance travelled =";DIS(u,t,a)
END
FUNCTION DIS (u, t, a)
S=u*t+1/2*a*t^2
DIS=S
END FUNCTION
Comments
Post a Comment