3. Implement a function called findLargestIndex which returns the index of the rowwith the largest sum.ex. int array[3][6] = {{3, 6, 8, 2, 4, 1}, // sum = 24{2, 4, 5, 1, 3, 4}, // sum = 19{1, 0, 9, 0, 1, 0}}; // sum = 11If the findLargestIndex function was called using this array, it would return 0, asit is returning the index of the row, not the sum.Note that the number of columns is required when passing a 2d array to a function.Assume that 2D arrays passed to this function will have 6 columns.Title line: int findLargestIndex(int array[][6], int rows, int columns);

Question
Asked Dec 7, 2019
195 views

3. Implement a function called findLargestIndex which returns the index of the row
with the largest sum.
ex. int array[3][6] = {{3, 6, 8, 2, 4, 1}, // sum = 24
{2, 4, 5, 1, 3, 4}, // sum = 19
{1, 0, 9, 0, 1, 0}}; // sum = 11
If the findLargestIndex function was called using this array, it would return 0, as
it is returning the index of the row, not the sum.
Note that the number of columns is required when passing a 2d array to a function.
Assume that 2D arrays passed to this function will have 6 columns.
Title line: int findLargestIndex(int array[][6], int rows, int columns);

check_circle

Expert Answer

Step 1

The function called findLargestIndex is used to find the index of a row whose all element sums are largest in an array.

Declare a 2-dimensional array with 3 rows and 6 columns.

Assign the value to the array.

Call the function to find the row index.

The function findLargestIndex called with three-parameter. One is array, second ...

Want to see the full answer?

See Solution

Check out a sample Q&A here.

Want to see this answer and more?

Solutions are written by subject experts who are available 24/7. Questions are typically answered within 1 hour.*

See Solution
*Response times may vary by subject and question.

Related Computer Science Q&A

Find answers to questions asked by student like you
Show more Q&A
add
question_answer

Q: Users can request certificates that aren't configured for autoenrollment by using the Certificates s...

A: The given statement is true i.e. By using the snap-in Certificates, users can request certificates t...

question_answer

Q: in c++  Given the following, use a for loop to load the array with user input (include a prompt ...

A: Program Algorithm-STARTStep1: Import the essential headersStep2: Define the main function.Step3: Dec...

question_answer

Q: explain step by step please.

A: The call to ex233(6) will start by checking if n=<0 as it is false the print statement will print...

question_answer

Q: In C++: Write a program which will prompt the user to enter an array of 12 characters. The program s...

A: Following is the c++ program that which takes input from user 12-character elements of array using f...

question_answer

Q: I have an assignment that requires me to read strings from a text file and insert them into a binary...

A: A C program for the given criteria is as follows,#include<stdio.h>#include<stdlib.h>#def...

question_answer

Q: In C++: You are working for a software firm that developed a word processor. A common error users of...

A: A C++ program for the given criteria is as follows,Program://Declare header files#include <iostre...

question_answer

Q: Let s1 be " Welcome " and s2 be " welcome ". Write the code for the following statements:a. Check wh...

A: We’ll answer the first three subparts of the question since the exact one wasn’t specified. Please s...

question_answer

Q: Why am I getting a error message when trying to INSERT data for the table??   (photo attached)

A: Error:The data type for the “DEPARTMENT_ID” is declared as “int” type in the CREATE query but the va...

question_answer

Q: Did I correctly perform the SQL query below (photo attached): A query that contains the GROUP BY cla...

A: Answer:“Yes”, the given query is correct.