10  IF  ERROR  THEN 1080
20  DIM A$[255],B$[255]
30  PRINT "Fast frequency distribution on test scores."
40  PRINT LIN(1);"Do you want instructions (Y/N): ";
50  LINPUT A$
60  A$=UOS$(A$)
70  IF A$[1,1]#"Y" THEN 160
80  PRINT 
90  PRINT "This program will compute the average, mean, maximum, minimum,"
100  PRINT "and frequency of a set of given scores.  Scores can be either"
110  PRINT "positive or negative.  Enter the data when promted for it.  To"
120  PRINT "terminate the input cycle, press the <RETURN> key alone.  You"
130  PRINT "will be then be prompted for the interval value to be used when"
140  PRINT "documenting the scores.  When completed, you will be returned to"
150  PRINT "the host controller."
160  S=S2=0
170  DIM X[900],Y[800],F[800]
180  PRINT 
190  PRINT "Enter each score seperately, type RETURN alone to complete input."
200  N=1
210  PRINT "Score";N;": ";
220  LINPUT A$
230  IF LEN(A$)=0 AND N>0 THEN 300
240  CONVERT A$ TO X[N],1471
250  IF N>890 THEN 300
260  N=N+1
270  GOTO 210
280  PRINT "Illegal input"
290  GOTO 210
300  N=N-1
310  L=H=X[1]
320  FOR I=1 TO N
330  S=S+X[I]
340  S2=S2+X[I]^2
350  X[I]=INT(X[I]+.5)
360  IF H>X[I] THEN 380
370  H=X[I]
380  IF L<X[I] THEN 400
390  L=X[I]
400  NEXT I
410  Z=H
420  M=S/N
430  D=SQR((N*S2-S^2)/(N*(N-1)))
440  PRINT 
450  PRINT "Interval size";
460  INPUT I1
470  A=H-L+1
480  IF I1=1 THEN 690
490  L1=L
500  IF L1/I1=INT(L1/I1) THEN 530
510  L1=L1-1
520  GOTO 500
530  H1=H
540  IF H1/I1=INT(H1/I1) THEN 570
550  H1=H1+1
560  GOTO 540
570  A=INT(H1/I1)+1
580  IF L1 >= 0 THEN 600
590  A=INT((H1-L1)/I1)+1
600  IF A>850 THEN 620
610  GOTO 640
620  PRINT "Please choose a larger interval."
630  GOTO 440
640  Y[A]=L1
650  FOR I=A-1 TO 1 STEP -1
660  Y[I]=Y[I+1]+I1
670  NEXT I
680  GOTO 780
690  Y[1]=H
700  Z=H-L+1
710  IF L<0 THEN 750
720  Z=H
730  IF H<850 THEN 750
740  Z=H-L+1
750  FOR I=2 TO Z
760  Y[I]=Y[I-1]-1
770  NEXT I
780  MAT F=ZER
790  FOR J=1 TO N
800  FOR I=1 TO A
810  IF X[J] >= Y[I] THEN 830
820  NEXT I
830  F[I]=F[I]+1
840  NEXT J
850  PRINT 
860  PRINT "Class"
870  PRINT "Interval       Frequency"
880  PRINT 
890  IF I1=1 THEN 960
900  FOR I=1 TO A
910  IF Y[I]>H THEN 940
920  K=Y[I]+I1-1
930  PRINT Y[I];"-   ";K;F[I]
940  NEXT I
950  GOTO 990
960  FOR I=1 TO A
970  PRINT Y[I],F[I]
980  NEXT I
990  PRINT 
1000  PRINT "Number of scores computed:";N
1010  PRINT 
1020  PRINT "Maximum score:";H
1030  PRINT "Minimum score:";L
1040  PRINT "Sum of scores:";S
1050  PRINT "Sum squared  :";S2
1060  PRINT "Mean         :";M
1070  PRINT "Standard Deviation:";D
1080  CHAIN R,"*HELP"
1090  SYSTEM X,"BYE"
1100  END 
