+ 1
Where is the problem?
2 Answers
+ 1
I think you are doing Element modify in line no.31 so use
ModifyElement2(X,1);
Instead of ModifyArray2(X,1);
+ 3
The message is:
//Ùۧ ۱ۊÙÙ
public class Scoresofstudents {
public static void main(String[] args) {
double [] X = {14,16,19,20,15};
System.out.format("n \t= %d\n",X.length);
System.out.format("Sum \t= %f\n",ArraySum(X));
System.out.format("Mean \t= %f\n",ArrayMean(X));
./Playground/Scoresofstudents.java:30: error: method ModifyArray2 in class Scoresofstudents cannot be applied to given types;
ModifyArray2(X,1);
^
required: double[]
found: double[],int
reason: actual and formal argument lists differ in length
1 error
That says what your problem is fairly well. You passed 2 parameters when only 1 is expected.
One solution is changing: ModifyArray2(X,1);
to: ModifyArray2(X);
The above change will solve your compilation error.