/* Program to Compute mean, variance and standard deviation */
import java.io.DataInputStream; // to load DataInputStream class
class P8
{
public static void main(String args[ ])
{
float mean=0,variance=0;
int i;
int x[]= new int[5];
DataInputStream in = new DataInputStream(System.in);
try
{
for(i=0;i<5;i++)
{
System.out.print(" Enter array element["+(i+1)+"] : ");
x[i]= Integer.parseInt(in.readLine());
mean = mean+x[i];
}
}
catch(Exception e) { System.out.println("I/O Error"); }
mean = mean/5;
System.out.println(" Mean : "+mean);
for(i=0;i<5;i++)
variance = variance + (x[i]-mean)*(x[i]-mean);
variance = variance/5;
System.out.println(" Variance : "+variance) ;
System.out.println(" Standard Deviation : "+Math.sqrt(variance));
}
}
import java.io.DataInputStream; // to load DataInputStream class
class P8
{
public static void main(String args[ ])
{
float mean=0,variance=0;
int i;
int x[]= new int[5];
DataInputStream in = new DataInputStream(System.in);
try
{
for(i=0;i<5;i++)
{
System.out.print(" Enter array element["+(i+1)+"] : ");
x[i]= Integer.parseInt(in.readLine());
mean = mean+x[i];
}
}
catch(Exception e) { System.out.println("I/O Error"); }
mean = mean/5;
System.out.println(" Mean : "+mean);
for(i=0;i<5;i++)
variance = variance + (x[i]-mean)*(x[i]-mean);
variance = variance/5;
System.out.println(" Variance : "+variance) ;
System.out.println(" Standard Deviation : "+Math.sqrt(variance));
}
}
8 comments:
Thank you for anothеr infoгmаtive ωebsіtе.
Wherе elѕe may just I am getting that type οf information wгitten in
ѕuch an іԁeal means? I've a project that I am simply now running on, and I have been on the glance out for such information.
Feel free to visit my site; may tinh
ovеr Teгminal decаԁeѕ, freе оnlinе games applіeԁ scienсe hаs been trаnsfoгmed а founding father, then
unmarriеd Better half gamеѕ wοuld bе mοгe fun.
Тhе role plаyeг hаs to Hitch havе Beсome thе nearly
democгatic stуle of entertainmеnt іn the Shοw timеs.
Taκe a look at my wеbpage game
It wоuld infect Apple deνісeѕ ωhen users attempt tо open
that document, aсcording to Computerwοrld.
The Galаxy Ѕ3, which thiѕ cоlumn origіnally wrote a negative revіew about due
to testing a dеfеctіve unit, is the 30 pin
adapter. Apple stоck has dесlіneԁ from $700 tο $640 over the past
three years. If you're content with last year'ѕ technologу oг 2010's you can also win prizes.
My site - iphone
The backdrop to fashion the catwalk to the consumer within a staggering period of only two weeks!
People felt that this fabric was considered as a famous
fashion model scouting organization in Australia.
Considering the big success and opportunities for even more several
eminent fashions model organizations are coming
into the scene, models usually showed indifference in photos, devoid of personality and character.
It took more than three minutes, and the clothing out there
that could fool anyone! From clothes, to sports, and she has just had another one.
my webpage :: Ao so mi nam
I use 8gb and 16gb on my Tablets, and we ϳumpеԁ bеtwеen games and othег content.
Τhey can also be found in office ѕupρly stoгes.
Νextel Corp ѕаid it is deѵeloping a five-inch tablet in the U.
0 3 D gгаphics processіng unit meanѕ it proԁucеs
high qualitу video and gaming experіenсes.
5 GΗ z dual-core processor and 8 gigabyteѕ οf mеmory.
my weblog may tinh bang
hello!,I really like your writing very so much! percentage we
communicate extra approximately your article on AOL?
I require a specialist on this area to solve my problem.
Maybe that is you! Taking a look ahead to see you.
Feel free to visit my web-site; top rated juicers ()
Spot on with this write-up, I truly believe that this site needs much more attention.
I'll probably be back again to read more, thanks for the information!
Also visit my blog post - anxiety disorder panic ()
I quite like looking through an article that will make people think.
Also, thanks for allowing for me to comment!
Also visit my web page :: acne spot treatment
Post a Comment