Can anyone tell me why I keep getting a value of 0 returned?
public static void main(String[] args) {
double getSum = 0;
double getAverage = 0;
String num1 = JOptionPane.showInputDialog(null, "Please enter your first number");
String num2 = JOptionPane.showInputDialog(null,"Please enter your second number");
String num3 = JOptionPane.showInputDialog(null, "Please enter your third number");
JOptionPane.showMessageDialog(null, "The sum is " + getSum);
JOptionPane.showMessageDialog(null, "The average is " + getAverage);
}
public static double getSum(double num1, double num2, double num3) {
double getSum = num1 + num2 + num3;
return getSum;
}
public static double getAverage1(double num1, double num2, double num3) {
double getAverage = num1 + num2 + num3 / 3;
return getAverage;
}