Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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,
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): 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 test21 = {'a', 'B', '8', 't', 'G', Output: The function will compute the minimum as !, the maximum ast, and the average as 73.1667
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