Trailing-Edge
-
PDP-10 Archives
-
decuslib10-01
-
43,50110/histgr.uti
There are 2 other files named histgr.uti in the archive. Click here to see a list.
100' NAME--HISTGRAM
110'
120' DESCRIPTION--PLOTS A HISTOGRAM OF SCORES ON A TEST.
130'
140' SOURCE--RONALD FAGIN'67
150'
160' INSTRUCTIONS--D IS THE INCREMENT BETWEEN SCORES. THUS
170' IF ALL SCORES ARE A MULTIPLE OF 5, D IS 5. IN A TYPICAL TEST WHERE
180' ANY INTEGRAL SCORE CAN BE ATTAINED, D IS 1. IT IS
190' ASSUMED IN THIS PROGRAM THAT NO MORE THAN 50 PEOPLE ATTAIN
200' ANY GIVEN SCORE. GIVE AS DATA STARTING IN LINE 1000 FIRST D, THEN
210' THE NUMBER OF PEOPLE WHO TOOK THE TEST, THEN
220' THE SCORES, ONE AT A TIME.
230'
240'
250' * * * * * * * MAIN PROGRAM * * * * * * * *
260'
270 DIM A(1000)
280 READ D,N
290 MAT READ A(N)
300 LET L=R=A(1)
310 FOR I=2 TO N
320 IF A(I)>L THEN 340
330 LET L=A(I)
340 IF A(I)<R THEN 360
350 LET R=A(I)
360 NEXT I
370 PRINT "SCORE","NUMBER OF PEOPLE"
380 PRINT
390 FOR I=L TO R STEP D
400 LET S=0
410 PRINT I,
420 FOR J=1 TO N
430 IF A(J)<>I THEN 450
440 LET S=S+1
450 NEXT J
460 FOR J=1 TO S
470 PRINT "*";
480 NEXT J
490 PRINT
500 NEXT I
1000 DATA 2,10, 88,94,96,98,86,88,84,96,88,84
2000 END