1 COMMON A, AL, B, BASEONLY, C, C$, C1, CAT$, CC, CKT$, D, D$, DD, DIA, DIMN$, DMS, E, EO, EX$, F, F$, FD, FF, FQ, FRQ, G$, GO$, I, I$, L, LATLONG, LD, LL, LN, LS, LW, LX, MAX, MENU, MIN, MX, N, NN, NT, OV, P, PI, PROG$, Q, QQ, QU, R, RA, RC, T, T$, U, U$, UH, UL$, V$, VC, W, WHIP, WIRD, WW, X, X$, X1, XS, Z$, ZP, ZS
10 'QUADRAT - 17 FEB 87  rev. 10 FEB 2004
20 IF EX$=""THEN EX$="EXIT"
30 CLS:KEY OFF
40 COLOR 7,0,5
50 PI=3.141592
60 L$=STRING$(26,196)
70 UL$=STRING$(80,205)
80 COLOR 15,1
90 PRINT " QUADRATIC EQUATION";TAB(61);;"by George C. Murphy ";
100 COLOR 5,0:PRINT STRING$(80,223);
110 COLOR 7,0
120 '
130 '.....start
140 LOCATE 13,22
150 COLOR 0,7:PRINT " Press 1 to continue or 0 to EXIT..... ";:COLOR 7,0
160 Z$=INKEY$:IF Z$=""THEN 160
170 IF Z$="0"THEN CLS:RUN EX$
180 IF Z$="1"THEN 200
190 GOTO 350
200 LOCATE CSRLIN-1:PRINT STRING$(80,32);:LOCATE CSRLIN-1
210 VIEW PRINT 3 TO 24:CLS:VIEW PRINT:LOCATE 3
220 X$(1)="a":X$(2)="b":X$(3)="c"
230 GOTO 470
240 '
250 VIEW PRINT 3 TO 24:CLS:VIEW PRINT:LOCATE 3
260 '
270 IF Z=1 THEN COLOR 15,3 ELSE COLOR 7,0
280 LOCATE CSRLIN,2:PRINT X$(1);
290 COLOR 7,0:PRINT "xý";
300 IF Z=2 THEN COLOR 15,3 ELSE COLOR 7,0
310 IF VAL (X$(2))>=0 THEN PRINT "+";
320 PRINT X$(2);
330 COLOR 7,0:PRINT "x=";
340 IF Z=3 THEN COLOR 15,3 ELSE COLOR 7,0
350 PRINT X$(3)
360 IF Z=0 THEN PRINT L$:GOTO 500
370 PRINT
380 COLOR 7,0:LOCATE CSRLIN,2
390 LOCATE CSRLIN-1:PRINT STRING$(80,32);:LOCATE CSRLIN-1
400 PRINT " ENTER:";:COLOR 15,3:PRINT " Hi-lited";
410 COLOR 7,0
420 IF Z=2 THEN PRINT "(if negative, enter as a minus quantity e.g. -3 )";
430 PRINT " factor";
440 INPUT Y(Z):X$(Z)=STR$(Y(Z))
450 RETURN
460 '
470 FOR Z=1 TO 3:GOSUB 250:NEXT Z
480 VIEW PRINT 3 TO 24:CLS:VIEW PRINT:LOCATE 3
490 Z=0:GOSUB 270
500 A=Y(1):B=Y(2):C=Y(3)
510 X1=(-B+SQR(B^2+4*A*C))/(2*A)
520 X2=(-B-SQR(B^2+4*A*C))/(2*A)
530 VIEW PRINT 5 TO 24:CLS:VIEW PRINT:LOCATE 5
540 PRINT "  Value of x is either:";
550 PRINT L$
560 COLOR 15,3:PRINT " ";X1;:COLOR 7,0
570 PRINT " or ";
580 COLOR 15,3:PRINT " ";X2:COLOR 7,0
590 PRINT UL$;
600 GOSUB 630:GOTO 130
610 GOTO 130
620 END
625 '
630 '.....PRT
640 KEY OFF:GOSUB 710:LOCATE 25,5:COLOR 0,2
650 PRINT " Send this page to:(1)Printer Queue? (2)Printout? ";
660 PRINT "(3)Next page? (1/2/3)";:COLOR 7,0
670 Z$=INKEY$:IF Z$<"1"OR Z$>"3"THEN 670 ELSE GOSUB 710
680 IF Z$="3"THEN RETURN
690 FOR I%=1 TO 24:FOR J%=1 TO 80:LPRINT CHR$(SCREEN(I%,J%));:NEXT J%:NEXT I%
700 IF Z$="2"THEN LPRINT CHR$(12) ELSE 640
710 LOCATE 25,1:PRINT STRING$(80,32);:RETURN
