100 REM  NAME--HISTGRAM
110 REM
120 REM  DESCRIPTION--PLOTS A HISTOGRAM OF SCORES ON A TEST.
130 REM
140 REM  SOURCE--RONALD FAGIN'67
150 REM
160 REM  INSTRUCTIONS--D IS THE INCREMENT BETWEEN SCORES. THUS
170 REM  IF ALL SCORES ARE A MULTIPLE OF 5, D IS 5. IN A TYPICAL 
180 REM  TEST WHERE ANY INTEGRAL SCORE CAN BE ATTAINED, D IS 1. IT 
190 REM  IS ASSUMED IN THIS PROGRAM THAT NO MORE THAN 50 PEOPLE ATTAIN
200 REM  ANY GIVEN SCORE. GIVE AS DATA STARTING IN LINE 1000 FIRST D,
210 REM  THEN THE NUMBER OF PEOPLE WHO TOOK THE TEST, THEN
220 REM  THE SCORES, ONE AT A TIME. 
230 REM
240 REM
250 REM  *  *  *  *  *  *  *  MAIN PROGRAM  *  *  *  *  *  *  *  *
260 REM
270 DIM A(1000)
280 READ D,N
290 FOR I=1 TO N:READ A(I):NEXT I
300 LET L=A(1):LET 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