540 XX = FN X(A(1,Z1)):YY = FN Y(A(1,Z)): GOSUB 590: IF PF THEN HPLOT XX,YY
550 FOR L = 2 TO NR(Z1):XX = FN X(A(L,Z1)):YY = FN Y(A(L,Z)): GOSUB 590: IF NOT PF THEN 580
560 IF CF = 1 THEN HPLOT TO XX,YY
570 IF CF = 0 THEN HPLOT XX,YY
580 NEXT L: RETURN
590 PF = -1: IF XX <48 THEN PF = 0
600 IF XX >279 THEN PF = 0
610 IF YY <9 THEN PF = 0
620 IF YY >171 THEN PF = 0
630 RETURN
640 PRINT : INPUT "DO YOU WANT GRID LINES DRAWN ?";Z$:GF = 10: IF LEFT$(Z$,1) = "Y" THEN GF = 1
650 IF LEFT$(Z$,1) = "N" THEN GF = 0
660 IF GF = 10 THEN PRINT : PRINT "PLEASE ANSWER YES OR NO.": GOTO 640
670 RETURN
680 Z$ = T$:XX = 20 - LEN(T$)/2: IF LEN(T$) <34 THEN XX = XX +3
690 YY = 0: GOSUB 360:Z$ = X$:XX = 20 - LEN(X$)/2: IF LEN(X$) <34 THEN XX = XX +3
700 YY = 23: GOSUB 360: RETURN
710 FOR J = LY TO HY -JY STEP JY:Z$ = STR$( FN R(J)):XX = 7 *(7 - LEN(Z$)): IF XX <0 THEN Z$ = ""
720 YY = FN Y(J): HPLOT 47,YY TO 49,YY:YY = YY -4: GOSUB 370: NEXT J: RETURN
730 FOR L = 1 TO MC:MIN(L) = 99999:MAX(L) = -99999:SUM(L) = 0:NR(L) = 0: NEXT L
740 PRINT "HOW MANY COLUMNS OF DATA DO YOU WISH TO ": INPUT "ENTER :";Z$:NC = VAL(Z$): IF NC <1 OR NC >MC THEN PRINT : PRINT "YOU CAN HAVE ONLY 1 TO "MC" COLUMNS.": FOR L = 1 TO 2000: NEXT L: HOME : GOTO 740
750 VTAB 9: PRINT "PLEASE ENTER A HEADING FOR EACH COLUMN."
760 A = 1
770 FOR L = A TO NC
780 VTAB L +10: PRINT "COLUMN "L" ";: INPUT C$(L): IF C$(L) = "" THEN VTAB L +10: CALL -868: GOTO 780
790 NEXT L
800 FOR L = A TO NC:Z = 0
810 TEXT : HOME : PRINT "PLEASE ENTER YOUR DATA FOR COLUMN "L: PRINT "PRESS 'RETURN' WHEN FINISHED.": PRINT : PRINT "COLUMN "L": "C$(L): GOSUB 250: POKE 34,5
820 Z = Z +1: PRINT "ROW "Z": ";: INPUT "";Z$:A(Z,L) = VAL(Z$): IF Z$ = "" THEN Z = Z -1: GOTO 880
830 IF A(Z,L) <MIN(L) THEN MIN(L) = A(Z,L)
840 IF A(Z,L) >MAX(L) THEN MAX(L) = A(Z,L)
850 SUM(L) = SUM(L) +A(Z,L)
860 IF Z = MR THEN PRINT : PRINT "THE MAXIMUM NUMBER OF ROWS HAS BEEN": PRINT "ENTERED.": GOSUB 190: GOTO 880
870 GOTO 820
880 NR(L) = Z: IF AF = 1 THEN RETURN
890 NEXT L
900 TF = 1: PRINT : PRINT : PRINT "ALL DATA HAS BEEN ENTERED.": GOSUB 190: TEXT : GOTO 3510
910 GOSUB 240: GOSUB 250: PRINT : PRINT "PLEASE ENTER THE COLUMN TO ADD TO.": PRINT : INPUT "COLUMN:";Z$
920 FOR L = 1 TO NC: IF Z$ = C$(L) THEN Z = L: GOTO 940
930 NEXT L:Z = VAL(Z$): IF Z <1 OR Z >NC +(NC <MC) THEN 3610
940 IF Z = NC +1 THEN A = Z:NC = Z:MIN(Z) = 99999:MAX(Z) = -99999:SUM(Z) = 0:NR(Z) = 0: HOME : VTAB 8: PRINT "PLEASE ENTER A COLUMN HEADING.": GOTO 770
970 HOME : GOSUB 240: GOSUB 250: PRINT : PRINT "PLEASE ENTER THE COLUMN FOR STATISTICAL": PRINT "EVALUATION. ENTER 'ALL' TO COMPUTE EACH": PRINT "COLUMN."
980 PRINT : INPUT "COLUMN: ";Z$: IF Z$ = "ALL" THEN 1020
990 FOR L = 1 TO NC: IF Z$ = C$(L) THEN GOSUB 1050: GOTO 1040
1000 NEXT L
1010 L = VAL(Z$): IF L >0 AND L < = NC THEN GOSUB 1050: GOTO 1040
1020 FOR L = 1 TO NC: GOSUB 1050: IF L = NC THEN 1040
1130 E = 0: FOR L = 1 TO NC: IF NR(L) >E THEN E = NR(L)
1140 NEXT L
1150 INVERSE : PRINT " ";: FOR L = 1 TO 3: IF L >NC THEN 1190
1160 PRINT " ";: IF LEN(C$(L)) <10 THEN PRINT LEFT$(SP$,10 - LEN(C$(L)));C$(L);: GOTO 1180
1170 PRINT LEFT$(C$(L),10);
1180 NEXT L
1190 PRINT : PRINT " ";: FOR L = 1 TO 3: IF L >NC THEN 1210
1200 PRINT " ";L;: NEXT L: REM 11 SPACES
1210 PRINT : PRINT " ": NORMAL :A = 1:B = L -1:D = 1:C = 0
1220 C = C +1: GOSUB 1410: PRINT : IF C <17 THEN 1220
1230 INVERSE : PRINT " ": PRINT "PRESS C TO CHANGE A VALUE, ESC TO QUIT.": NORMAL
1240 TEXT : VTAB 24: HTAB 1: PRINT "COMMAND: ";: GET Z$
1250 IF Z$ = "M" AND C <E THEN VTAB 21: HTAB 1: POKE 35,21: POKE 34,3: PRINT : VTAB 21: INVERSE : PRINT " ";: NORMAL :C = C +1:A = A +1: VTAB 20: HTAB 1: GOSUB 1410: GOTO 1240
1260 IF Z$ = "I" AND A >1 THEN VTAB 4: HTAB 1: POKE 34,3: POKE 35,20: CALL 768:Z = C:C = A -1: GOSUB 1410:C = Z -1:A = A -1: GOTO 1240
1270 IF Z$ = "K" AND B <NC THEN POKE 32,5: POKE 33,35: POKE 35,20: FOR L = 1 TO 12: CALL 847: NEXT L:Z1 = 30: TEXT :Z = B +1: GOSUB 1470:D = D +1:B = B +1: GOTO 1240
1280 IF Z$ = "J" AND D >1 THEN POKE 32,4: POKE 33,36: POKE 35,20: FOR L = 1 TO 12: CALL 810: NEXT :Z1 = 6: TEXT :Z = D -1: GOSUB 1470:D = D -1:B = B -1: GOTO 1240
1290 IF Z$ < >"C" THEN 1390
1300 POKE 34,23: PRINT
1310 INPUT "ENTER COLUMN,ROW TO CHANGE :";Z$,X$:Z1 = VAL(Z$):Z = VAL(X$): IF Z <A OR Z >C OR Z1 <D OR Z1 >B OR Z >NR(Z1) THEN 1240
1320 TEXT : VTAB (Z -A) +4: HTAB 6 +((Z1 -D) *12):XX = A(Z,Z1): GOSUB 110: INVERSE : PRINT Y$: VTAB 24: POKE 34,23: NORMAL
1330 INPUT "NEW NUMBER :";Z$:XX = VAL(Z$): TEXT : GOSUB 110: VTAB (Z -A) +4: HTAB 6 +((Z1 -D) *12): PRINT Y$
1510 XX = A(L,Z): GOSUB 110: HTAB Z1: PRINT Y$: NEXT L: RETURN
1520 HOME : GOSUB 240: GOSUB 250: PRINT
1530 PRINT "DATA IS SORTED INDEPENDENTLY OF THE ": PRINT "OTHER COLUMNS. PLEASE ENTER THE COLUMN": PRINT "TO SORT, JUST PRESS 'RETURN' TO QUIT.": PRINT
1540 INPUT "COLUMN: ";Z$
1550 GOSUB 260
1560 PRINT : INPUT "SORT A)SCENDING OR D)ESCENDING: ";Z$:D = 10: IF LEFT$(Z$,1) = "A" THEN D = 0
1780 HOME : PRINT "THE BEST LINEAR FIT FOR THIS DATA IS:": GOSUB 250: VTAB 8: PRINT "Y = ";:XX = SL: GOSUB 110: PRINT Y$;" X + ";:XX = IN: GOSUB 110: PRINT Y$: PRINT
1840 VTAB 23: CALL -868: INPUT "INCREMENT BY :";Z$:B = VAL(Z$): IF B = 0 THEN 1840
1850 FOR L = 1 TO 7: PRINT : NEXT : VTAB 6: GOSUB 250: POKE 34,7: IF LEN(C$(Z1)) >14 THEN PRINT LEFT$(C$(Z1),15);: GOTO 1870
1860 PRINT TAB( 15 - LEN(C$(Z1)));C$(Z1);
1870 IF LEN(C$(Z)) >15 THEN PRINT TAB( 20) LEFT$(C$(Z),15): GOTO 1890
1880 PRINT TAB( 35 - LEN(C$(Z)));C$(Z)
1890 CALL -868: PRINT
1900 FOR L = A -5 *B TO A +5 *B STEP B:XX = L: GOSUB 110: PRINT TAB( 5);Y$;:XX = SL *L +IN: GOSUB 110: PRINT TAB( 25);Y$: NEXT L
1910 GOTO 1810
1920 GOSUB 240: GOSUB 250: PRINT : PRINT "PLEASE ENTER COLUMN TO TRANSFORM.": PRINT : INPUT "COLUMN :";Z$: GOSUB 260
1930 PRINT : PRINT "DO YOU WANT TO R)EPLACE THE COLUMN OR": PRINT : INPUT "A)DD AS A NEW COLUMN ?";Z$: IF LEFT$(Z$,1) = "R" THEN Z1 = Z: GOTO 1970
1940 IF LEFT$(Z$,1) < >"A" THEN 1930
1950 Z1 = NC +1
1960 PRINT : PRINT "PLEASE ENTER HEADING FOR THE NEW COLUMN.": PRINT "COLUMN "Z1":";: INPUT "";C$(Z1): IF C$(Z1) = "" THEN 1960
1970 HOME : PRINT "PLEASE ENTER A TRANSFORMATION FORMULA": PRINT : PRINT "USING X AS A DUMMY VARIABLE.": PRINT : PRINT "FOR EXAMPLE, TO SQUARE THE DATA ENTER,": PRINT : PRINT "'X^2' OR TO DIVIDE THE DATA ENTER"
1980 PRINT : PRINT "'X/100'.": PRINT : PRINT "PLEASE USE STANDARD APPLE SYNTAX.": PRINT
1990 INPUT "FORMULA : ";X$: IF X$ = "" THEN 3610
2000 A = 16401: PRINT : HTAB 9: INVERSE : PRINT "COMPUTING, PLEASE WAIT": NORMAL
2010 FOR L = 1 TO LEN(X$): RESTORE
2020 READ Z$,XX: IF Z$ = "XXX" THEN 2060
2030 IF MID$ (X$,L,3) = Z$ THEN POKE A,XX:L = L +2: GOTO 2070
2040 IF MID$ (X$,L,1) = Z$ THEN POKE A,XX: GOTO 2070
2050 GOTO 2020
2060 POKE A, ASC( MID$ (X$,L,1))
2070 A = A +1: IF A >16430 THEN PRINT : PRINT "FORMULA IS TOO LONG, PLEASE RE-ENTER.": PRINT : GOTO 1990
2080 NEXT L
2090 DATA +,200,-,201,*,202,/,203,^,204,INT,211,ABS,212,SQR,218,LOG,220,EXP,221,COS,222,SIN,223,TAN,224,ATN,225,XXX,10
2780 GOSUB 240: GOSUB 250: PRINT : PRINT "PLEASE ENTER THE COLUMN TO PLOT WITH.": PRINT : INPUT "COLUMN: ";Z$: GOSUB 260: IF NR(Z) >12 THEN PRINT "SORRY, ONLY 12 BARS CAN BE PLOTTED.": GOSUB 190: GOTO 3510
2790 GOSUB 290: GOSUB 310: GOSUB 640
2800 M$ = "JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC"
2810 PRINT : PRINT "HOW DO YOU WANT THE X AXIS LABELED:": PRINT : PRINT "1. BY YEAR": PRINT "2. BY MONTH": PRINT "3. NOT AT ALL": PRINT : INPUT "SELECTION :";Z$
2820 LF = VAL(Z$): IF LF <1 OR LF >3 THEN 2810
2830 IF LF = 1 THEN PRINT : INPUT "ENTER STARTING YEAR :";Z$:E = VAL(Z$): GOTO 2870
2840 IF LF = 3 THEN 2870
2850 PRINT : INPUT "ENTER STARTING MONTH :";Z$: FOR L = 1 TO 12: IF LEFT$(Z$,3) = MID$ (M$,3 *L -2,3) THEN E = L: GOTO 2870
2890 HOME : VTAB 5: PRINT "PRESS 'ESC' TO RETURN TO THE TEXT PAGE": PRINT : PRINT "AFTER THE PLOT."
2900 FOR L = 1 TO 2000: NEXT L
2910 HGR : POKE -16302,0: HCOLOR= 3: HPLOT 48,9 TO 48,171 TO 279,171
2920 IF GF = 1 THEN FOR L = LY TO HY STEP JY:YY = FN Y(L): HPLOT 48,YY TO 279,YY: NEXT L: HPLOT 279,171 TO 279,9
2930 FOR L = 1 TO NR(Z):YY = FN Y(A(L,Z)):XX = 48 +(L *JX): FOR J = 171 TO YY STEP -1: HPLOT XX -A,J TO XX +A,J: NEXT J: NEXT L
2940 GOSUB 680: GOSUB 710
2950 IF LF = 1 THEN FOR J = 1 TO NR(Z):YY = 174:XX = (48 +(J *JX)) -6:Z$ = RIGHT$( STR$(E),2): GOSUB 370:E = E +1: NEXT J
2960 IF LF < >2 THEN 3000
2970 FOR J = 1 TO NR(Z):YY = 174:XX = (48 +(J *JX)) -3:Z$ = MID$ (M$,3 *E -2,1): GOSUB 370:E = E +1
2980 IF E >12 THEN E = 1
2990 NEXT J
3000 GET Z$: IF Z$ < > CHR$(27) THEN 3000
3010 TEXT : GOTO 3510
3020 GOSUB 240: GOSUB 250: PRINT : PRINT "PLEASE ENTER THE COLUMN TO PLOT WITH.": PRINT : INPUT "COLUMN: ";Z$: GOSUB 260: IF NR(Z) <2 OR NR(Z) >12 THEN PRINT : PRINT "SORRY, ONLY 1-12 SLICES ARE ALLOWED.": GOSUB 190: GOTO 3510
3030 PRINT : PRINT "PLEASE ENTER A LABEL FOR EACH ROW.": PRINT : PRINT TAB( 20)"--LABEL--": PRINT
3040 FOR L = 1 TO NR(Z): PRINT "ROW "L"="; FN R(A(L,Z));: HTAB 20: INPUT L$(L): NEXT L
3050 PRINT : GOSUB 290: GOSUB 310: HOME : VTAB 5: PRINT "PRESS ESC TO RETURN TO THE TEXT PAGE": PRINT : PRINT "AFTER THE PLOT.": FOR L = 1 TO 2000: NEXT L
3060 HGR : POKE -16302,0: HCOLOR= 3: GOTO 3080
3070 XX = 1.1 *B * COS(A):YY = B * SIN(A): RETURN
3080 B = 78:A = 0: GOSUB 3070: HPLOT XX +194,100 -YY
3090 FOR A = 0 TO 6.35 STEP .05: GOSUB 3070: HPLOT TO XX +194,100 -YY: NEXT A
3100 A = 0: FOR L = 1 TO NR(Z):A = A +(A(L,Z)/SUM(Z)) *6.3: GOSUB 3070: HPLOT 194,100 TO XX +194,100 -YY: NEXT L
3490 VTAB 19: PRINT TAB( 9)"PRESS ANY KEY TO BEGIN": COLOR= 10: HLIN 0,39 AT 0: HLIN 0,39 AT 46: VLIN 0,47 AT 0: VLIN 0,47 AT 39
3500 POKE STRB,0: WAIT KB,128: POKE STRB,0
3510 HOME : INVERSE : PRINT " --MENU-- ": NORMAL
3520 VTAB 3: PRINT "1. ENTER A NEW DATA TABLE.": PRINT "2. LIST/EDIT A DATA TABLE.": PRINT "3. ADD TO A DATA TABLE."
3530 PRINT "4. PRINT BASIC STATISTICS FOR A TABLE.": PRINT "5. TRANSFORM THE DATA.": PRINT "6. PERFORM LINEAR REGRESSION ON TABLE.": PRINT "7. SORT THE DATA TABLE.": PRINT "8. LIST DATA TABLE ON PRINTER."
3540 PRINT "9. SAVE THE TABLE TO DISK.": PRINT "10. LOAD A TABLE FROM DISK.": PRINT : PRINT "11. DRAW A SCATTER PLOT.": PRINT "12. DRAW A BAR GRAPH."
3550 PRINT "13. DRAW A PIE GRAPH.": PRINT "14. LABEL/VIEW A GRAPH.": PRINT "15. SAVE GRAPH TO DISK."
3560 PRINT "16. LOAD A GRAPH FROM DISK.": PRINT "17. DUMP GRAPHICS SCREEN TO PRINTER.": PRINT "18. END PROGRAM."
3570 VTAB 23: CALL -868: INPUT "ENTER A NUMBER AND PRESS 'RETURN' :";Z$:Z = VAL(Z$): IF Z <1 OR Z >18 THEN 3570
3580 HOME : IF NC >0 AND (Z = 1 OR Z = 10 OR Z = 18) THEN VTAB 5: PRINT "ANY DATA THAT HAS NOT BEEN SAVED WILL": PRINT "BE LOST. OKAY TO PROCEED?(Y/N)": GET Z$: PRINT : HOME : IF Z$ < >"Y" THEN 3510
3590 IF (Z < >1 AND Z < >10 AND Z < >14 AND Z < >16 AND Z < >15 AND Z < >17 AND Z < >18) AND TF = 0 THEN VTAB 8: PRINT "THERE IS NO DATA TABLE, TRY 1 OR 10.": GOSUB 190: GOTO 3510
3600 ON Z GOTO 730,1130,910,960,1920,1690,1520,3190,3810,3870,2430,2780,3020,2260,3920,3940,3290,3730