Traditional Culture Encyclopedia - Photography major - Homework problem: java homework sum, average value, maximum number, minimum number, standard deviation
Homework problem: java homework sum, average value, maximum number, minimum number, standard deviation
Please refer to the following
Public static main(String[] args){
Int[] is = {3,2,5,35,17,28,2145,7};
int max = is[0];
int min = is[0];
int sum = 0;
Double ave = 0.0
Double StanDev = 0.0
for(int I = 0; I & ltis.lengthi++){
if(is[I]& gt; Max) {
max = is[I];
}
if(is[I]& lt; Minimum) {
min = is[I];
}
sum+= is[I];
}
ave = sum * 1.0/is . length;
for(int I = 0; I & ltis.lengthi++){
sum+= math . sqrt((double)is[I]-ave)*(is[I]-ave));
}
StanDev =(sum/(num- 1));
System.out.println ("the minimum value is:"+min);
System.out.println ("the maximum value is:"+max);
System.out.println ("average:"+ave);
System.out.println ("standard deviation is"+Standev); }
- Related articles
- Where is the lavender flower sea around Wuhan in 2022?
- Is Nanning Huangjia Courtyard worth going to?
- A letter of commendation from the waiter
- Who can tell me some information about tennis ~ ~ ~
- Zhu ziqing information
- What is the introduction of Chinese rose?
- Documentary photography cover design works
- What skills does a photographer have to take a successful portrait?
- Classical sentences about dawn and enlightening sentences related to dawn (20 sentences)
- "East Palace" episode 34: That can remember the dream of spring, according to the incense banquet (6)