Trailing-Edge
-
PDP-10 Archives
-
decuslib20-01
-
decus/20-0020/mstdev.tuk
There are 2 other files named mstdev.tuk in the archive. Click here to see a list.
10' NAME--MSTDEV
15'
20' DESCRIPTION--COMPUTES THE MEAN AND STANDARD DEVIATION OF
21' YOUR GRADES
25'
30' SOURCE--UNKNOWN
35'
40' INSTRUCTIONS
50 REM 1. IN LINE 900 ENTER THE NUMBER OF STUDENTS IN YOUR CLASS.
60 REM TO DO THIS, TYPE "900 DATA 20". (THIS IS FOR A CLASS OF
65 REM 20 STUDENTS.)
70 REM 2. BEGINNING IN LINE 901 ENTER THE GRADES IN DECIMAL FORM.
80 REM TO DO THIS, TYPE "901 DATA 2.3,4.8,5.0,3.7"
90 REM "902 DATA 4.2,3.5,2.7,4.9,4.8"
100 REM "903 DATA 2.6,4.7,3.8"
110 REM ETC.
120
130 REM TO CORRECT OR CHANGE A GRADE RETYPE THE LINE,
140 REM REMEMBERING TO RETYPE THE STATEMENT NUMBER AND THE WORD "DATA".
160 REM WHEN ALL DATA IS ENTERED, TYPE "RUN" AND THE RETURN KEY.
161'
162' THIS PROGRAM WAS WRITTEN FOR STUDENT USE AT AMOS TUCK SCHOOL
163' OF HANOVER, N.H., WHICH DOES NOT ASSUME RESPONSIBILITY FOR
164' ITS ACCURACY.
165'
166' * * * * * * * * * * * * MAIN PROGRAM * * * * * * * * * * * * *
167'
170 READ N
180 LET S1 = 0
190 LET S2 = 0
200 FOR I = 1 TO N
210 READ G
220 LET S1 = S1+G
230 LET S2 = S2+(G*G)
240 NEXT I
250 LET M = S1/N
260 PRINT "MEAN" M
270 LET V = (S2/N)-((S1^2)/N^2)
280 PRINT "VARIANCE" V
290 LET D = SQR(V)
300 PRINT "STANDARD DEVIATION" D
900 DATA 24
901 DATA 4.2,4.0,4.6,3.6,3.7,4.8
902 DATA 3.7,3.6,4.3,2.7,3.9,3.8
903 DATA 3.6,4.3,5.0,3.5,3.6,5.0
904 DATA 3.6,4.4,4.3,4.1,3.0,4.0
9999 END