Page 1 of 1

In the following program, method calculateListAvg (LinkedList aList) is defined to calculate the average of Linkedlist e

Posted: Fri Jul 08, 2022 7:27 am
by answerhappygod
In The Following Program Method Calculatelistavg Linkedlist Alist Is Defined To Calculate The Average Of Linkedlist E 1
In The Following Program Method Calculatelistavg Linkedlist Alist Is Defined To Calculate The Average Of Linkedlist E 1 (43.83 KiB) Viewed 38 times
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 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)