Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The output should look like this: 1. Ask users to input 9 integers and store them in a 2D array with 3 rows and 3
The output should look like this:
1. Ask users to input 9 integers and store them in a 2D array with 3 rows and 3 columns. 2. Call the printMatrix function to print the 2D array obtained at Step 1. 3. Call the sumcolumn function to find the sum of each column of the 2D array. 4. Call the printArray function to print the column sums obtained at Step 3. 5. Call the largestValue function to find the largest sum out of all column sums obtained at Step 3. and then print it. 6. Call the largestIndex function to find out of all column sums obtained at Step 3, how many are equal to the largest sum and their indexes. Print the number of columns having the largest sum. 7. Call the printArray function to print the indexes obtained at Step 6, representing the indexes of columns that have the largest sum. Enter an int: 4 Enter an int: 5 Enter an int: 6 Enter an int: 2 Enter an int: 1 Enter an int: 0 Enter an int: 1 Enter an int: 1 Enter an int: 1 The matrix is: 4 5 6 2 1 0 1 1 1 The colum sums: 7 7 7 The largest column sum: 7 3 column(s) having the largest sum, column index(es): 0 1 2 1. Ask users to input 9 integers and store them in a 2D array with 3 rows and 3 columns. 2. Call the printMatrix function to print the 2D array obtained at Step 1. 3. Call the sumcolumn function to find the sum of each column of the 2D array. 4. Call the printArray function to print the column sums obtained at Step 3. 5. Call the largestValue function to find the largest sum out of all column sums obtained at Step 3. and then print it. 6. Call the largestIndex function to find out of all column sums obtained at Step 3, how many are equal to the largest sum and their indexes. Print the number of columns having the largest sum. 7. Call the printArray function to print the indexes obtained at Step 6, representing the indexes of columns that have the largest sum. Enter an int: 4 Enter an int: 5 Enter an int: 6 Enter an int: 2 Enter an int: 1 Enter an int: 0 Enter an int: 1 Enter an int: 1 Enter an int: 1 The matrix is: 4 5 6 2 1 0 1 1 1 The colum sums: 7 7 7 The largest column sum: 7 3 column(s) having the largest sum, column index(es): 0 1 2
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