Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Harness The Power Of Big Data The IBM Big Data Platform

Authors: Paul Zikopoulos, David Corrigan James Giles Thomas Deutsch Krishnan Parasuraman Dirk DeRoos Paul Zikopoulos

1st Edition

0071808183, 9780071808187

More Books

Students also viewed these Databases questions

Question

How do Excel Pivot Tables handle data from non OLAP databases?

Answered: 1 week ago