Question
I need help finishing steps 3-7 of the following two JAVA programs. /** ArrayOperations class Chapter 8, Programming Challenge 10 */ public class ArrayOperations {
I need help finishing steps 3-7 of the following two JAVA programs.
/**
ArrayOperations class
Chapter 8, Programming Challenge 10
*/
public class ArrayOperations
{
/**
STEP1: getTotal method.
@param array An array of doubles.
@return The total of the values stored in the
argument array.
*/
public double getTotal(double[] array){
double sum=0.0;
for(int i=0; i {sum+=array[i];} return sum;} /** STEP2: getAverage method @param array An array of doubles. @return The average of the values stored in the argument array. */ public double getAverage(double[] array1){ double average=getTotal(array1)/array1.length; return average;} /** STEP3: getHighest method @param array An array of doubles. @return The highest value in the argument array. */ public double getHighest(double[] array2){ } /** Demo program for the ArrayOperations class Chapter 8, Programming Challenge 10 */ import java.util.Scanner; public class ArrayOperationsDemo { public static void main(String[] args) { // Some arrays of various types. //step4: Declare an 5-element double array Scanner scan = new Scanner(System.in); // Process the array. //step5: declare an object for array operation //step6: find the sum of the above array and print the result. //step7: find the highest value in the above array and print the result. } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started