home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 September / Simtel20_Sept92.cdr / msdos / turbopas / pas_sci.arc / MEANS.PAS < prev    next >
Pascal/Delphi Source File  |  1985-07-21  |  651b  |  30 lines

  1. program means;          { -> 26 }
  2. {find mean and standard deviation }
  3.  
  4. const   max     = 80;
  5.  
  6. type    ary     = array[1..max]of real;
  7.  
  8. var     x       : ary;
  9.         i,n     : integer;
  10.         mean,std: real;
  11.  
  12. {$I MEANSTD.PAS}
  13.  
  14. begin   { MAIN program }
  15.  ClrScr;
  16.  writeln;
  17.  writeln('Calculation of mean and standard deviation');
  18.  repeat
  19.         write('How many points? ');
  20.         readln(n)
  21.  until n<=max;
  22.  for i:=1 to n do
  23.         begin
  24.          write(i:3,':');
  25.          readln(x[i])
  26.         end;
  27.  meanstd(x,n,mean,std);
  28.  writeln(chr(7),'For ',n:3,' points, mean= ',mean:8:4,' sigma= ',std:8:4)
  29. end.    { MAIN program }
  30.