uses wincrt;
var data,datakuadrat,i,n: integer;
sigmax2,total,total2,mean,varian,stdev: real;
begin
write('jumlah data yaitu '); readln(n);
i:=0;
total:=0;
total2:=0;
while i
i:=i+1;
write('nilai data ke ',i,' ? '); readln(data);
total:=total+data;
total2:=total2+(data*data);
end;
mean:=total/n;
stdev:=sqrt((total2-((total*total)/n))/(n-1));
varian:=stdev*stdev;
writeln('total nilai = ',total:3:2);
writeln('rata-rata nilai = ',mean:3:2);
writeln('standard deviasi = ',stdev:3:2);
writeln('varians = ',varian:3:2);
end.
Tidak ada komentar:
Posting Komentar