program statistika_deskriptif;
uses wincrt;
var
x:array [1..100] of real;
mean,rata,varians,s_2,standar_deviasi,s_d:real;
n,j,i:integer;
begin
write('masukkan n banyaknya angka = ');
readln(n);
for i:=1 to n do
begin
write(i, ' = ' );
readln(x[i]);
end;
rata:=0;
for i:=1 to n do
rata:=rata+x[i];
mean:=rata/n;
writeln('mean= ',mean:0:0);
varians:=0;
for i:=1 to n do
begin
write('varians= ');
readln(s_2);
s_2:=sqr(x[i]-mean);
writeln('varians= ',s_2:0:0);
end;
s_d:=0;
for i:=1 to n do
begin
write('standar deviasi= ');
writeln(s_d);
s_d:=sqrt(s_2);
writeln('standar deviasi= ',s_d:0:0);
end;
end.
Kamis, 05 Januari 2012
Langganan:
Posting Komentar (Atom)
0 komentar:
Posting Komentar