24) CALCULATE DISTANCE TRAVELED BY BODY.(FUNCTION)
DECLARE FUNCTION DIS (U,T,A)
CLS
INPUT " ENTER ACCELERATION";A
INPUT " ENTER TIME";T
INPUT " ENTER INITIAL VELOCITY";U
PRINT " DISTANCE TRAVELED BY BODY =";DIS(U,T,A)
END
FUNCTION DIS (U,T,A)
D = U * T + 1 / 2 * A * T ^ 2
DIS = D
END FUNCTION
0 comments