Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I don\'t understand java at all so if you could explain every line of code and d

ID: 3593417 • Letter: I

Question

I don't understand java at all so if you could explain every line of code and do the code as simple as possible that would be great!

EGR 140: Computer Programming Assignment # 17 Assigned: Friday, 13October 2017 Due: Wedresday. 18 October 2017 Points: 20 Write an error-free Java program to do the following things. . Prpt the user to input a set af nurbers. The user should be ale to input up ta 20 nurmbers but if the user enters-1 then the data input peeses. All af the data that the user enters shauld be stored in a single array. The numbers may be integers or nn-integers and can be positive ar negative. the slardard deviation the skesyness of the progam shauld calculate th numbers that were entered. The formulas for the variance and the skewness ithe third centralized moment) are given by The Standard deviation-s- (n-1 Skewness where x are the individul nurbers, n is the nurrber of data paints, s is the standard deviation, and is the average of the sarple The skewriess and the standard deviation mst be alulated vi as to amethod. That is, there must be a melhod that calclates the starderd deviation and a separate method hat calculates the skewness. .At the end, the program should repeat all of the numbers on one line and then print the average, standard deviation, and skewness of the data saple. Example: IEnter data value (1 to quit) 67 Enter next data value (-1 to quit): 98 Enter next data valuo (-1 to quit): S9 Enter next data value (1 to quit): 45 Enter next data valuo (-1 to quit): 1 · You en te red 4 numbers The data values are . é 67.9 98.0 89.0 45.9 ·*.. The average is 74.75 · The standard deviation is 23 . 725864g2979582 · The skewness is -0.28288515763584543 Remember to put the usual header at the top of the progamandto submit via Canves.

Explanation / Answer

import Java.util.scanner;

public class my class{

static float avg=0;

static float std_dev=0;

public static void main(String[] args){

float[] numbers = new float[20];

int count=0;

Scanner in = new Scanner(System.in);

for(int i=0;i<20;i++){

System.out.println("Enter the data value (-1 to quit) : ");

float a = in.nextFloat();

if(a==-1) break;

else{

numbers[count] = a;

count++;

}

}

System.out.println("You have entered "+count+" numbers ");

System.out.println("The data values are.. ");

float sum=0;

for(int i= 0;i<count;i++) {

System.out.println(""+numbers[i]+" ");

sum = sum+numbers[i];

}

avg = sum/count;

System.out.println("The average is "+(sum/count)+" ");

printstandarddeviation(numbers,count);

printskewness(numbers,count);

}

static void printstandarddeviation(float[] numbers, int count){

float sd =0;

for(int i =0;i<count;i++){

sd =sd+((numbers[i] - avg)(numbers[i] - avg));

}

sd=sd/(count-1) ;

sd = Math.sqrt(sd);

std_dev = sd;

System.out.println("The standard deviation is "+ sd);

}

static void printskewness(float[] numbers, int count){

float sk;

for(int i=0;i<count;i++){

sk =sk+(numbers[i] ×avg);

}

sk = sk/ (count -1);

sk =sk/(std_dev × std_dev × std_dev);

System.out.println("The skewness is "+sk);

}

}