I am trying to write a program to calculate mean & standard deviation.
I sort of figured out how to find mean (it is not correct yet, so i am going to need help on this part as well) but how do you do standard deviation?
import java.util.Scanner;
public class Mean {
public static void main(String[] args){
int sum = 0, inputNum;
int counter;
float mean;
Scanner NumScanner = new Scanner(System.in);
Scanner charScanner = new Scanner(System.in);
System.out.println("Enter the total number of terms whose mean you want to calculate");
counter = NumScanner.nextInt();
System.out.println("Please enter " + counter + " numbers:");
for(int x = 1; x<=counter ;x++){
inputNum = NumScanner.nextInt();
sum = sum + inputNum;
System.out.println();
}
mean = sum / counter;
System.out.println("The mean of the " + counter + " numbers you entered is " + mean);
}
}
The above is what i have so far, there are errors but hopefully we can build from there?