10 REM BASIC PROGRAM TO GENERATE N TERMS OF A FIBONACCI SERIES,
20 REM THE FIRST TWO TERMS OF WHICH ARE SPECIFIED BY THE USER.
30 REM
40 REM PRINT THE IDENTIFYING MESSAGE
50 PRINT "PROGRAM TO GENERATE A FIBONACCI SERIES"
60 REM
70 REM GET THE LENGTH AND FIRST TWO TERMS OF THE SERIES
80 PRINT "HOW MANY TERMS DO YOU WANT GENERATED";
90 INPUT L
100 IF L<>0 THEN 130
110 REM IF USER REQUESTS 0 TERMS, TERMINATE EXECUTION
120 STOP
130 PRINT "WHAT IS THE FIRST TERM";
140 INPUT T1
150 PRINT "WHAT IS THE SECOND TERM";
160 INPUT T2
170 REM MAKE SURE L IS NOT NEGATIVE OR TOO LARGE
180 IF L<3 THEN 200
190 IF L<50 THEN 220
200 PRINT L;"TERMS DO NOT REALLY MAKE SENSE,"
210 GO TO 80
220 REM PRINT THE FIRST TWO TERMS OF THE SERIES
230 PRINT "THE REQUESTED SERIES IS"
240 PRINT T1
250 PRINT T2
260 L=L-2
270 REM CALCULATE NEXT TERM AND PRINT IT
280 N=T1+T2
290 T1=T2
300 T2=N
310 PRINT N
320 REM DETERMINE IF SERIES IS FINISHED. IF SO, DO NEXT ONE.
330 L=L-1
340 IF L<=0 THEN 80
350 GO TO 280
360 END
