In the following program, method calculateListAvg (LinkedList aList) is defined to calculate the average of Linkedlist e
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
In the following program, method calculateListAvg (LinkedList aList) is defined to calculate the average of Linkedlist e
questions in the answer area 1. Complete method calculateListAvg (LinkedList aList) to calculate the average of LinkedList aList (parameter) (6 points) 2. In the Main(), call method calculateListAvg (LinkedList aList) to calculate and print the average of newlist elements (3 points) 3. If the program is executed, what is the output of the program? (2 points)
In the following program, method calculateListAvg (LinkedList aList) is defined to calculate the average of Linkedlist elements. public class Test { public static void main (String args[]) { LinkedList<Double> newlist = new LinkedList<Double>(); for (int i = 1; i < 6; i++) { } newlist.add(i*10.0); //2. put your codes in the answer area } // end of main () public static double calculateListAvg (LinkedList aList) { //1. put }// end of calculateListAvg () your codes in the answer area } // end of Test Answer the following three