+ 1
Whats wrong with my program?
import java.util.Scanner; public class Main { Static double sum; public static void main(String[] args) { Scanner read = new Scanner(System.in); double score1 = read.nextDouble(); double score2 = read.nextDouble(); double score3 = read.nextDouble(); double score4 = read.nextDouble(); double avgScore = getAverageScore(score1, score2, score3, score4); System.out.println(avgScore); } //create your method here public static double getAverageScore(double a,double b,double c, double d) { sum = a+b+c+d; double res = sum/4; return res; } }
2 RĂ©ponses
+ 1
static double sum; // small s in static
+ 1
Oh, what a stupid mistakeđ