Google
 

Trailing-Edge - PDP-10 Archives - decuslib20-01 - decus/20-0020/grader.uti
There are 2 other files named grader.uti in the archive. Click here to see a list.
100'  NAME--GRADER
110'
120'  DESCRIPTION--CALCULATES THE TERM AVERAGES FOR A STUDENT, AND
130'  FINDS THE CLASS AVERAGE, BOTH TO THE NEAREST TENTH
140'  OF A POINT.
150'
160'  SOURCE--UNKNOWN
170'
180'  INSTRUCTIONS--TYPE "RUN" AND FOLLOW INSTRUCTIONS.  THE INPUTS
190'  INCLUDE THE GRADES FOR EACH STUDENT AND THE WEIGHTS TO APPLY
200'  TO EACH COMPONENT GRADE.
210'
220'
230'  *  *  *  *  *  *  *  MAIN PROGRAM  *  *  *  *  *  *  *  *  *  *
240'  
250   PRINT "TO COMPUTE THE TERM AVERAGE FOR A STUDENT, SIMPLY FOLLOW THE"
260 PRINT "DIRECTIONS."
270   PRINT
280 PRINT "HOW MANY GRADES DO YOU HAVE FOR EACH STUDENT";
290   INPUT X
300  PRINT
310  PRINT "NOW TYPE THE";X;"WEIGHTS YOU WANT TO APPLY TO EACH COMPONENT"
320 PRINT "GRADE, SEPARATED BY COMMAS."
330 MAT INPUT W
340 IF NUM=X THEN 370
350 PRINT "YOU DID NOT TYPE IN";X;"WEIGHTS.  RETYPE THEM."
360 GOTO 330
370 PRINT
380 PRINT "ALWAYS TYPE THE";X;"GRADES SEPARATED BY COMMAS."
390 PRINT "IF A CERTAIN GRADE IS MISSING, TYPE '-1' IN PLACE"
400 PRINT "OF TYPING THAT PARTICULAR GRADE."
410 PRINT "WHEN YOU HAVE FINISHED, TYPE";X;"GRADES OF '-1'."
420 PRINT
430 PRINT "GRADES OF THE FIRST STUDENT";
440 MAT INPUT X
450 IF NUM=X THEN 480
460 PRINT "YOU DID NOT TYPE IN";X;"GRADES.  RETYPE THEM."
470 GOTO 440
480  LET S = 0
490 LET S1 = 0
500  FOR I = 1 TO X
510 IF X(I) < 0 THEN 540
520     LET S = S + X(I)*W(I)
530 LET S1 = S1+W(I)
540  NEXT I
550 IF S1 = 0 THEN 630
560 LET N = N+1
570 LET S = INT(10*S/S1 + .5)/10
580 LET S2 = S2+S
590 PRINT "AVERAGE IS";S
600  PRINT
610  PRINT "NEXT STUDENT";
620 GOTO 440
630 PRINT
640 LET S2 = S2/N
650 PRINT "THERE ARE";N;"STUDENTS IN THE CLASS."
660 PRINT "THE CLASS AVERAGE IS";INT(S2*10+.5)/10
670 END