10 MODE8:DIM:GOSUB500:c$=CHR$(5):m=2:k=1:n=1:x=0
20 CLS:PRINT"Cumulative frequency H(x,n,M,N)";
30 z=m:s$="N":GOSUB400:m=z:IFm<2 THEN30
40 z=k:s$="M":GOSUB400:k=z:IFk>m THEN40
50 z=n:s$="n":GOSUB400:n=z:IFn>m-k THEN50
60 z=x:s$="x":GOSUB400:x=z:IFx>n ORx>k THEN60
65 LOCATE0,1:PRINTc$;".....";
70 sr=0:GOSUB"LIB0:S6330":GOSUB500:IFsr THEN*
75 IFs THENs=ROUND(s,LOG(ABSs)-6)
80 PRINTc$;"p=";s;:z$=INPUT$(1,@):GOTO30
400 LOCATE0,1:PRINTc$;s$;"=";z;"?";:INPUT@10;z:LOCATE0,0:IFz<0 ORFRACz<>0 THEN400 ELSERETURN
500 ONERRORGOTO510:RETURN
510 IFERR=1 THENCLS:ONERRORGOTO0
520 IFERL=400 THENRESUME400
530 LOCATE0,1:PRINTc$;"not found";:z$=INPUT$(1,@):RESUME20