Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Database Concepts

Authors: David M. Kroenke, David J. Auer

7th edition

133544621, 133544626, 0-13-354462-1, 978-0133544626

More Books

Students also viewed these Databases questions