10 PRINT "INTEGRATION: TRAPEZOIDAL RULE"
20 PRINT
30 REM - ENTER FUNCTION HERE (DEFFNC(x)="function")
35 DEF FNC(X)=X[3
40 PRINT "(ENTER 0,0 TO END PROGRAM)"
50 PRINT "INTEGRATION LIMITS (Lower, UPPER)";
60 INPUT A,B
69 REM - END PROGRAM?
70 IF A=B THEN 190
80 PRINT "number OF INTERVALS";
90 INPUT N
100 I=0
110 D=(B-A)/N
119 REM - ADD UP THE AREA OF EACH TRAPEZOID
120 FOR J=A TO B STEP D
130 I=I+FNC(J)
140 NEXT J
149 REM - COMPUTE INTEGRAL, PRINT
150 I=(I-(FNC(A)+FNC(B))/2)*D
160 PRINT "integral =";I
170 PRINT
180 GOTO 50
190 END
