Question: C++ General requirements: - No global variables - No multiple return statements in one function - Show how you have tested these functions - cin

C++

General requirements: - No global variables - No multiple return statements in one function - Show how you have tested these functions - cin and cout are not allowed in these function. They can only be in main() or testing functions. It should return the values to the caller through the use of return type and pass-by-reference parameters. - Please do not use struct, tuple or pair class. Please use only pass-by-reference parameters and return type to return values to the caller. - Please do not use string class - Please do not change or sort the array Note: this is an exercise to use functions, arrays and C-string which is an array of characters with NULL terminated character.

Question #1: Write a function named "findTheLargest" that accepts an array of integers and its size. It will return three different values: - the value of the largest element in the array - the boolean value of true if the largest number in the array is the first or the last element in that array and false otherwise - the count of how many largest numbers of the same value in the array. For examples, If this is called with the array of {10}, it will return 10, true and 1. If this is called with the array of {10, 10}, it will return 10, true and 2. If this is called with the array of {10, 20, 10}, it will return 20, false and 1. If this is called with the array of {10, 20, 20, 10}, it will return 20, false and 2. If this is called with the array of {10, 5, 2, 3, 4, 10}, it will return 10, true and 2. If this is called with the array of {50, 20, 30, 40, 10}, it will return 50, true and 1. If this is called with the array of {10, 30, 40, 10}, it will return 40, false and 1.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!