Standard Deviation Program with Pascal  

Posted by: DK in ,

In statistics and probability, standard deviation or standard deviation is a measure of statistical distribution of the most common. In short, he measured how the data values spread. Standard deviation is defined as the square root of variance. Standard deviation is non-negative integer, and has the same units as the data. For example, if a data is measured in meters, then the standard deviation is also measured in meters as well. The term was first standard deviation introduced by Karl Pearson in 1894, in his book On the Dissection of Asymmetrical frequency curves. like the previous exercise program will be made here to calculate the standard deviation, or better known as the standard deviation by using the programming language pascal. Here is the complete source code:

Program Calculate_the_standard_deviation;
Uses Crt;
Var X,N,I:Byte;
Akar,Jum,Rata,Sd,K,Y,Sigma,Pangkat:Real;
Data:Array[1..30] of byte;
Function Pengurangan(A,I:Byte):Integer;
Begin
Pengurangan:= A-I ;
end;
Procedure NilaiData;
Begin
Write (’What is the number of Data Value= ‘);Readln(X);
For N:=1 to x do
Begin
Write(’Data to-’,N,’=');Readln(Data[N]);
end;
end;
Procedure RataRata;
Begin
Jum:=0;
For N:=1 to X do
Begin
Jum:=Jum + Data[N] ;
Rata:= Jum / X;
end;
end;
Procedure PangkatSigma;
Begin
SIGMA:=0;
For N:= 1 to X do
Begin
Pangkat:=0;
K:= Data[N]-Rata;
Pangkat:= SQR (K);
Sigma:= Sigma+Pangkat;
end;
end;
Procedure TampilHasil;
Begin
For N:= 1 to X Do
Begin
Writeln (’Value data to- ‘,N,’=',Data[N]);
end;
end;

Begin
clrscr;
Sigma:=0;
Rata:=0;
Writeln (’>> Calculating Standard Deviation <<’);
NilaiData; RataRata; PangkatSigma; I:=1; Y:=Pengurangan(X,I); Akar:=Sigma/Y ; Sd:= SQRT (Akar);
Clrscr;
Writeln (’Standard Deviation Calculation Results’);
TampilHasil;
Writeln (’The number of Data Value =’,X);
Writeln (’Value Average rating = ‘,Rata:4:2);
Writeln (’Standard deviation is = ‘,Sd:4:2);
Readln;
end.
Copyright © Dede Kurniadi

This entry was posted on Monday, August 24, 2009 and is filed under , . You can leave a response and follow any responses to this entry through the Subscribe to: Post Comments (Atom) .

0 comment

Post a Comment