Question: Error in my java code on the sum + = value; portion of my code. I do not know what or why the syntax error
Error in my java code on the sum value; portion of my code. I do not know what or why the syntax error is being thrown. My code is below:
import java.util.Scanner;
public class Main
public static void mainString args
double values inputValues;
double average calculateAveragevalues;
printAverageaverage;
public static double inputValues
Scanner scanner new ScannerSystemin;
double values new double;
System.out.printlnEnter three double values: ;
for int i ; i i
System.out.printValuei:;
valuesi scanner.nextDouble;
return values;
public static double calculatAverage double values
double sum ;
for double value : values
sum value; THIS CODE LINE IS GIVING ME A SYNTAX ERROR, BUT APPEARS CORRECT. WHAT AM I MISSING?
return sum values.length;
public static void printAveragedouble average
System.out.printlnThe average of the three values is: average;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
