10 REM   **************************************************************
20 REM   **************************************************************
30 REM   ***                                                        ***
40 REM   ***     C L A S S   G R A D E   M A I N T E N A N C E      ***
50 REM   ***                                                        ***
60 REM   ***                     P R O G R A M                      ***
70 REM   ***                                                        ***
80 REM   ***     HARRY HAWKINS                  NOVEMBER, 1983      ***
90 REM   ***                                                        ***
100 REM  ***         CONFIGURED FOR THE OSBORNE EXECUTIVE           ***
110 REM  ***                                                        ***
120 REM  **************************************************************
130 REM  **************************************************************
140 REM
150 GOSUB 3010:REM   ****       CLEAR SCREEN SUBROUTINE             ****
160 DIM AR(200): REM ***** CLEAR SCREEN SUBROUTINE  *****
170 LINE INPUT "ENTER TODAY'S DATE SUCH AS: NOV. 18, 1983.";Z$
180 DATE$=Z$
190 INPUT "DO YOU WANT TO MAKE CHANGES IN AN EXISTING FILE? <Y/N>.";Z$
200 IF Z$="Y" THEN 280
210 INPUT "DO YOU WANT TO CREATE A NEW CLASS LIST? <Y/N>.";Z$
220 IF Z$="N" THEN 280
230 INPUT "ENTER NEW CLASS NUMBER AND SECTION.";Z$
240 LET Z1$=Z$: OPEN"R",#1,Z$: REM *** OPEN CLASS DATA FILE         ***
250 FIELD#1,30 AS NA$,30 AS AD$,11 AS NU$,1 AS FL$,1 AS LG$,7 AS T0$,48 AS T1$
260 GOTO 520
270 GOSUB 3010
280 INPUT "ENTER CLASS NUMBER AND SECTION.";Z$
290 LET Z1$=Z$
300 OPEN "R",#1,Z$
310 FIELD#1,30 AS NA$,30 AS AD$,11 AS NU$,1 AS FL$,1 AS LG$,7 AS T0$,48 AS T1$
320 GOSUB 3010
330 PRINT "               S E L E C T I O N     M E N U "
340 PRINT
350 PRINT "     1.  INSERT NEW TEST GRADES ........... TYPE <TST>"
360 PRINT "     2.  ADD NEW STUDENTS TO THE LIST ..... TYPE <STU>"
370 PRINT "     3.  DELETE STUDENTS FROM LIST ........ TYPE <DEL>"
380 PRINT "     4.  CORRECT STUDENT GRADES ........... TYPE <COR>"
390 PRINT "     5.  CALCULATE LETTER GRADES .......... TYPE <LTR>"
400 PRINT "     6.  GET A CLASS LISTING .............. TYPE <LST>"
410 PRINT "     7.  EXIT FROM THE PROGRAM ............ TYPE <EX>"
420 PRINT
430 INPUT "MAKE SELECTION FROM MENU:";Z$
440 IF Z$="TST" THEN 750
450 IF Z$="STU" THEN 1220
460 IF Z$="DEL" THEN 1430
470 IF Z$="COR" THEN 1530
480 IF Z$="LTR" THEN 1850
490 IF Z$="LST" THEN 2450
500 IF Z$="EX" THEN CLOSE #1:END
510 GOTO 150
520 GOSUB 3010
530 INPUT "ENTER THE NUMBER OF STUDENTS IN THE CLASS.";Q
540 GET #1,1
550 LSET NA$="0"
560 LSET AD$="0"
570 LSET LG$=" "
580 RSET NU$=STR$(Q)
590 RSET T0$=STR$(Q)
600 Q=Q+1
610 PUT #1,1
620 FOR J=2 TO Q
630 INPUT "ENTER STUDENT NAME.";Z$
640 LSET NA$=Z$
650 INPUT "ENTER STUDENT'S LOCAL ADDRESS, (NUMBER & DORM OR STREET ONLY)";Z$
660 LSET AD$=Z$
670 INPUT "ENTER STUDENT NUMBER.";Z$
680 LSET NU$=Z$
690 LSET FL$=" "
700 LSET LG$=" "
710 RSET T0$="0"
720 PUT #1,J
730 NEXT J
740 GOTO 320
750 GOSUB 3010
760 GET #1,1
770 R%=VAL(NA$)*5
780 PRINT "YOU HAVE ALREADY GIVEN ";NA$
790 PRINT "TESTS WITH A MAXIMUM POSSIBLE SCORE OF ";AD$;" ."
800 INPUT "DO YOU WISH TO MAKE ANY CORRECTIONS WITH THIS DATA? <Y/N>.";Z$
810 IF Z$="N" THEN 920
820 PRINT "IS THE MAXIMUM POSSIBLE SCORE OF ";MID$(AD$,1,5);" CORRECT? <Y/N>."
830 INPUT Z$
840 IF Z$="Y" THEN 870
850 INPUT "ENTER CORRECT MAXIMUM SCORE.";Z$
860 LSET AD$=Z$
870 PRINT "IS ";MID$(NA$,1,5);" THE CORRECT NUMBER OF TESTS GIVEN? <Y/N>."
880 INPUT Z$
890 IF Z$="Y" THEN 920
900 INPUT "ENTER THE CORRECT NUMBER OF TESTS GIVEN.";Z$
910 LSET NA$=Z$
920 LSET NA$=STR$(VAL(NA$)+1)
930 INPUT "ENTER THE MAXIMUM POSSIBLE SCORE OF THIS TEST.";Z$
940 C=VAL(Z$)
950 LSET AD$=STR$(VAL(AD$)+VAL(Z$))
960 LSET T1$=MID$(T1$,1,R%)+MID$(Z$,1,5)
970 PUT #1,1
980 GET #1,1
990 Q=VAL(NU$)+1
1000 S=VAL(T0$)
1010 FOR J=2 TO Q
1020 GET #1,J
1030 IF FL$="W" THEN 1120
1040 PRINT "ENTER TEST SCORE FOR ";NA$
1050 INPUT Z$
1060 IF VAL(Z$)>C THEN 1040
1070 LSET T0$=STR$(VAL(T0$)+VAL(Z$))
1080 LSET T1$=MID$(T1$,1,R%)+MID$(Z$,1,5)
1090 PUT #1,J
1100 T=T+VAL(Z$)
1110 T2=T2+(VAL(Z$)^2)
1120 NEXT J
1130 A=T/S
1140 T=T^2
1150 D=SQR((T2-(T/S))/S)
1160 PRINT "AVERAGE OF THIS TEST IS: ";A
1170 PRINT "STANDARD DEVIATION OF THIS TEST IS: ";D
1180 PRINT:PRINT "<PRESS ANY KEY TO RETURN TO THE MENU>"
1190 O$=INKEY$
1200 IF O$="" THEN 1190 ELSE 1210
1210 GOTO 320
1220 INPUT "HOW MANY STUDENTS DO YOU WANT TO ADD TO THE LIST?";Z
1230 GET #1,1
1240 Q=VAL(NU$)+1
1250 RSET NU$=STR$(VAL(NU$)+Z)
1260 RSET T0$=STR$(VAL(T0$)+Z)
1270 PUT #1,1
1280 FOR J=1 TO Z
1290 INPUT "ENTER STUDENT'S NAME.";Z$
1300 LSET NA$=Z$
1310 INPUT "ENTER STUDENT'S ADDRESS.";Z$
1320 LSET AD$=Z$
1330 INPUT "ENTER NEW STUDENT'S NUMBER.";Z$
1340 LSET NU$=Z$
1350 LSET FL$=" "
1360 LSET LG$=" "
1370 LSET T0$="0"
1380 LSET T1$="0"
1390 B=J+Q
1400 PUT #1,B
1410 NEXT J
1420 GOTO 320
1430 GOSUB 3010
1440 INPUT "ENTER THE NUMBER LOCATION IN THE LIST OF THE STUDENT TO DROP.";Z
1450 Z=Z+1
1460 GET #1,Z
1470 LSET FL$="W"
1480 PUT #1,Z
1490 GET #1,1
1500 RSET T0$=STR$(VAL(T0$)-1)
1510 PUT #1,1
1520 GOTO 320
1530 GOSUB 3010
1540 INPUT "ENTER THE NAME OF STUDENT WHOSE GRADE(S) YOU WANT TO CORRECT.";Z$
1550 GET #1,1
1560 Q=VAL(NU$)+1
1570 Z=VAL(NA$)
1580 R%=1
1590 FOR Y=1 TO Q
1600 GET #1,Y
1610 IF NA$=Z$ THEN 1630
1620 NEXT Y
1630 FOR A=1 TO Z
1640 AR(A)=VAL(MID$(T1$,R%,5))
1650 NEXT A
1660 GOSUB 3010
1670 PRINT "YOU ARE ABOUT TO CHANGE TEST SCORES FOR ";NA$
1680 INPUT "ANSWER Y(ES) OR N(O).";Z$
1690 IF Z$="N" THEN 1530
1700 INPUT "HOW MANY TEST SCORES DO YOU WANT TO CHANGE?";C
1710 FOR A=1 TO C
1720 INPUT "WHICH TEST SCORE DO YOU WANT TO CHANGE?";B
1730 INPUT "ENTER CORRECT TEST SCORE.";AR(B)
1740 NEXT A
1750 RSET T0$="0"
1760 LSET T1$=" "
1770 R%=1
1780 FOR J=1 TO Z
1790 RSET T0$=STR$(VAL(T0$)+AR(J))
1800 LSET T1$=MID$(T1$,1,R%)+STR$(AR(J))
1810 R%=R%+5
1820 NEXT J
1830 PUT #1,Y
1840 GOTO 320
1850 GOSUB 3010
1860 PRINT"DO YOU WANT LETTER GRADES DETERMINED ON THE BASIS OF A NORMAL CURVE?"
1870 INPUT "ANSWER Y(ES) OR N(O)";Z$
1880 IF Z$="Y" THEN GOTO 2080
1890 GET #1,1
1900 Q=VAL(T0$)+1
1910 M=VAL(AD$)
1920 FOR J=2 TO Q
1930 GET #1,J
1940 IF FL$="W" THEN 2060
1950 L=VAL(T0$)/M
1960 IF L>=.9 THEN 2010
1970 IF L>=.8 THEN 2020
1980 IF L>=.7 THEN 2030
1990 IF L>=.6 THEN 2040
2000 LSET LG$="E":GOTO 2050
2010 LSET LG$="A":GOTO 2050
2020 LSET LG$="B":GOTO 2050
2030 LSET LG$="C":GOTO 2050
2040 LSET LG$="D"
2050 PUT #1,J
2060 NEXT J
2070 GOTO 2440
2080 ON ERROR GOTO 2100
2090 OPEN "R",#1,Z$
2100 GET #1,1
2110 Q=VAL(NU$)+1
2120 M=VAL(AD$)
2130 S=VAL(T0$)
2140 FOR J=2 TO Q
2150 GET #1,J
2160 IF FL$="W" THEN 2190
2170 T3=T3+VAL(T0$)
2180 T4=T4+VAL(T0$)^2
2190 NEXT J
2200 A=T3/S
2210 PRINT "AVERAGE TOTAL SCORE IS: ";A
2220 T3=T3^2
2230 ON ERROR GOTO 2250
2240 D=SQR((T4-(T3/S))/S)
2250 PRINT "STANDARD DEVIATION OF ALL TESTS IS: ";D
2260 PRINT "<PRESS ANY KEY TO CONTINUE>"
2270 Q$=INKEY$
2280 IF Q$="" THEN 2270
2290 FOR J=2 TO Q
2300 GET #1,J
2310 IF FL$="W" THEN 2430
2320 E=VAL(T0$)
2330 IF E>=(A+(3*D)) THEN 2380
2340 IF E>=(A+(2*D)) THEN 2390
2350 IF E>=A-D THEN 2400
2360 IF E>=(A-(2*D)) THEN 2410
2370 LSET LG$="E": GOTO 2420
2380 LSET LG$="A": GOTO 2420
2390 LSET LG$="B": GOTO 2420
2400 LSET LG$="C": GOTO 2420
2410 LSET LG$="D"
2420 PUT #1,J
2430 NEXT J
2440 GOTO 320
2450 GOSUB 3010
2460 INPUT "DO YOU WANT A HARD COPY OF THE LIST? (Y OR N)";Z$
2470 IF Z$="Y" THEN GOTO 2730
2480 GET #1,1
2490 GOSUB 3010
2500 PRINT,DATE$,"CLASS LIST FOR ";Z1$
2510 PRINT
2520 PRINT,"NUMBER OF TESTS GIVEN: ";NA$
2530 PRINT,"MAXIMUM POSSIBLE SCORE: ";AD$
2540 PRINT,"ORIGINAL NUMBER OF STUDENTS IN CLASS: ";NU$
2550 PRINT,"PRESENT NUMBER OF STUDENTS IN CLASS: ";T0$
2560 PRINT,"MAXIMUM INDIVIDUAL TEST GRADES ARE: ";T1$
2570 Q=VAL(NU$)+1
2580 FOR J=2 TO Q
2590 GET #1,J
2600 PRINT
2610 PRINT,"NAME: ";NA$
2620 PRINT,"ADDRESS: ";AD$
2630 PRINT,"STUDENT NUMBER :";NU$
2640 PRINT,"CURRENT STATUS <W=WITHDRAW>:";FL$
2650 PRINT,"LETTER GRADE :";LG$
2660 PRINT,"TOTAL POINTS : ";T0$
2670 PRINT,"TEST SCORES: ";T1$
2680 PRINT:PRINT
2690 FOR X=1 TO 1000:NEXT X
2700 NEXT J
2710 GOTO 320
2720 END
2730 REM  ***** PRINT ROUTINE FOR FX-80 *****
2740 LPRINT CHR$(27);"!";CHR$(8): REM *** SET UP EMPHASIZED TYPE ***
2750 LPRINT "               CLASS LIST AND GRADES - ELECTRONICS"
2760 LPRINT
2770 LPRINT "==================================================================="
2780 LPRINT
2790 GET #1,1
2800 LPRINT, DATE$, "CLASS LIST FOR ";Z1$
2810 LPRINT
2820 LPRINT,"NUMBER OF TESTS GIVEN :";NA$
2830 LPRINT,"MAXIMUM POSSIBLE SCORE IS :";AD$
2840 LPRINT,"ORIGINAL NUMBER OF STUDENTS :";NU$
2850 LPRINT,"PRESENT NUMBER OF STUDENTS :";T0$
2860 LPRINT,"MAXIMUM INDIVIDUAL TEST GRADES ARE :";T1$
2870 LPRINT
2880 Q=VAL(NU$)+1
2890 FOR J=2 TO Q
2900 GET #1,J
2910 LPRINT,"NAME :",NA$
2920 LPRINT,"ADDRESS :",AD$
2930 LPRINT,"STUDENT NUMBER :";NU$
2940 LPRINT,"STATUS <W=WITHDRAW> :";FL$
2950 LPRINT,"LETTER GRADE :";LG$
2960 LPRINT,"NUMBER OF STUDENTS IN CLASS :";T0$
2970 LPRINT,"INDIVIDUAL TEST SCORES :",T1$
2980 LPRINT:LPRINT
2990 NEXT J
3000 GOTO 320
3010 PRINT CHR$(26):RETURN: REM   CLEAR SCREEN SUBROUTINE          ***
3020 END
0 LPRINT:LPRINT
299