Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the following code snippets related to 2D Array. You need to implement the function sumOfEvenNumbersGreaterThan9 , whose arguments are number of rows, columns, and

  1. Consider the following code snippets related to 2D Array. You need to implement the function sumOfEvenNumbersGreaterThan9, whose arguments are number of rows, columns, and 2D Array. The function will sum all the even numbers greater than 9 from the 2D array. Finally, return the result to the main function.

int main()

{

int row = 3, col = 4;

//Dynamically create array of pointers of size row (ex 4)

int** A = new int* [row];

// Dynamically allocate memory of size col (5) for each row

for (int i = 0; i < row; i++)

A[i] = new int[col];

// Assign values to allocated memory

for (int i = 0; i < row; i++)

for (int j = 0; j < col; j++)

A[i][j] = j + 9;

int sum = sumOfEvenNumbersGreaterThan9(row, col, A);

cout << "In main sum is " << sum << endl;

}

a)

  1. Write the function sumOfEvenNumbersGreaterThan9().
  2. Show/Write the input 2D array in a matrix form based on the given code snippets.
  3. Output or results that sumOfEvenNumbersGreaterThan9() will return.

NEED IT NOW PLEASE

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_2

Step: 3

blur-text-image_3

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

Professional SQL Server 2000 Database Design

Authors: Louis Davidson

1st Edition

1861004761, 978-1861004765

More Books

Students also viewed these Databases questions

Question

Given that Vo = 48 60 -j60 1.2 Ideal Figure P8.517

Answered: 1 week ago