Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

THe following main method should print on out put thje total and average of all

ID: 3918349 • Letter: T

Question

THe following main method should print on out put thje total and average of all numbers in the int[] numbers array. Please complete the coding parts of both the getSum and getavg methods. You must use for or while loop statements for both methods.

G File: Practice.java CAUsers) W2103619521 Documents -jGRASP CSD (Java) File Edit View Bi Project Settings Tools Window Help All Fil? | So |? ublic class Practice public static void main (String [] args) C1UsersWV210| ? int [ ] numbers { 10, 40, 15, 20, 25, 30, 35, 5); double sum 0, Average=0; sum-getSum (numbers) Average=getavg (numbers) ; System.out.printin(" The Total"+sum; System .out.printIn(" The Average "+ Average); Practice.java public static int getsum (int Array]) int sum=0; //write code here return (sum) public static double getavg (int Array[]) int sum-0 //write code here return (sum/ Array.length) Practice.java Compile Messages jGRASP Messages Run IOInteractions Stop Clear Browse Find Debug Workbench Line:1 Col:22 Code:0 Top:1

Explanation / Answer

public static int getSum(int Array[]) { int sum = 0; for(int i = 0; i