Can someone please! Fix this for me?
My program :
loop reads 10 double numbers
after that
inserts them into an array list.
after that
print MAx and MIn And AVg
THIS MY PROGRAM WHY I CAN NOT MAKE COMPILE Fix this for me :
import java.util.Scanner;
import java.util.ArrayList;
import java.util.Collections;
public class Program {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
ArrayList<Double> numberz = new ArrayList<>();
double sum = 0.0;
double avg = 0.0;
System.out.println("Enter 10 numbers, New line for each Input.");
for (int i = 0; i < 10; i++)
numberz.add(in.nextDouble());
for (int i = numberz.size() -1; i >= 0; i--)
sum = sum + numberz.get(i);
Object maxRe = Collections.max(numberz);
Object minRe = Collections.min(numberz);
avg = sum/10;
System.out.println("Maximum = " + maxRe);
System.out.println("Minimum = " + minRe);
System.out.println("Average = " + avg);
}
}