Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in c++ double arrayStats(double array[], int size, double minimum, double maximum, double average) { minimum = array[1]; maximum = array[1]; double summation = array[1]; for

in c++image text in transcribedimage text in transcribed

double arrayStats(double array[], int size, double minimum, double maximum, double average) {

minimum = array[1]; maximum = array[1]; double summation = array[1]; for (int i = 0; i maximum) maximum = array[i]; if (array[i]

char arrayStats(char array[], int size, char minimum, char maximum, double average){ minimum = array[1]; maximum = array[1]; double summation = array[1]; for (int i = 0; i maximum) maximum = array[i]; if (array[i] In this exercise, the main code passes to the arrayStats function either arrays of characters, or arrays of floating-point numbers, and then returns the maximum, minimum, and average of each array. A fellow student tried to write the two following overloaded functions for arrayStats. However, there are major mistakes. You must fix the mistakes in the code such that it provides the correct output regardless of the input type. Do not write and submit the main subroutine, or any include statments, these are already written and hidden from you. However, if you want to test your solution in any IDE (e.g., CodeBlocks, CLion, Visual Studio, onlinegdb.com), then you will need to write your own main there for testing purposes. In the function header, do not change the order of the formal paramaters or add/remove others parameters. Do not change the function name. Any other modifications on the header are permitted. Sample Testcase 0 (not graded, for student use only): Input: Suppose main passes the following array to arrayStats: double test[] = {1.5, 7.8, 9.0, 3.4, 5.6, 0.5); Output: The function will compute the minimum as 0.5, the maximum as 9, and the average as 4.63333 Sample Testcase 1 (not graded, for student use only): Input: Suppose main passes the following array to arrayStats: char test2[] = {'a', 'B', '8', 't', 'G', '}; Output: The function will compute the minimum as !, the maximum ast, and the average as 73.1667 1 Type here to search DI 1 double arrayStats (double array[], int size, double minimum, double maximum, double average) { 2 3 4 5 6 7 8 9 10 minimum = array[1]; maximum = array[1]; double summation = array[1]; for (int i = 0; i maximum) maximum = array[i]; if (array[i] maximum) maximum = array[i]; if (array[i]

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

Advanced MySQL 8 Discover The Full Potential Of MySQL And Ensure High Performance Of Your Database

Authors: Eric Vanier ,Birju Shah ,Tejaswi Malepati

1st Edition

1788834445, 978-1788834445

More Books

Students also viewed these Databases questions

Question

7. Why is conciseness especially important in business?

Answered: 1 week ago

Question

4. Identify cultural variations in communication style.

Answered: 1 week ago

Question

9. Understand the phenomenon of code switching and interlanguage.

Answered: 1 week ago

Question

8. Explain the difference between translation and interpretation.

Answered: 1 week ago