10 PRINT "TRIG POLYNOMIAL"
20 PRINT
30 DATA 3,1,2,-2,1,5,-3
40 PRINT "(ENTER ANGLE=99999 TO END PROGRAM)"
50 PRINT "ANGLE";
60 INPUT R
69 REM - END PROGRAM?
70 IF R=99999 THEN 180
79 REM - GET NUMBER OF PAIRS OF TERMS IN POLYNOMIAL
80 READ N
89 REM - LOOP TO GET VALUES OF COEFFICIENTS FROM DATA TABLE
90 FOR I=1 TO N
100 READ A,B
109 REM - CALCULATE VALUE OF FUNCTION AT ANGLE X
110 Z=Z+A*SIN(I*R)+B*COS(I*R)
120 NEXT I
129 REM - PRINT RESULTS
130 PRINT "F(";R;")=";Z
139 REM - PREPARE TO REREAD FUNCTION COEFFICIENTS
140 RESTORE
150 PRINT
160 Z=0
169 REM - RESTART PROGRAM
170 GOTO 50
180 END
