Enter the gradebook page and line number, then the grades one after another, and -1 to finish. The program prints the average to three decimal places, worked out with integer division because the 4K ZX80 has no decimals. CONT starts the next student.
Totals of grades must stay under 32767.
Published in Syntax October 1981 (Gradebook for Teachers).
Source Code
1 PRINT "GRADEBOOK PAGE NUMBER IS ";
2 INPUT PG
3 PRINT PG
4 PRINT "GRADEBOOK LINE NUMBER IS ";
5 INPUT ID
6 PRINT ID
10 LET N=0
20 LET G1=0
25 PRINT "GRADE"
30 INPUT G
40 IF G<0 THEN GO TO 300
50 PRINT G
60 LET N=N+1
70 LET G1=G+G1
80 GO TO 30
300 LET X=G1
310 LET Y=N
320 LET Z=X/Y
330 LET R1=X-Z*Y
340 LET D1=10*R1/Y
350 LET R2=10*R1-D1*Y
360 LET D2=10*R2/Y
370 LET R3=10*R2-D2*Y
380 LET D3=10*R3/Y
390 PRINT "THE AVERAGE IS---";Z;".";D1;D2;D3
400 STOP
410 GO TO 2Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.
