Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercise 1: Suppose that you have the following declarations: int flowers[28][10]; int animals[15][10]; int trees[100][10]; int inventory[30][10]; a. Write the definition of the function readIn

Exercise 1: Suppose that you have the following declarations:

int flowers[28][10];

int animals[15][10];

int trees[100][10];

int inventory[30][10];

a. Write the definition of the function readIn that can be used to input data into these arrays. Also write C++ statements that call this function to input data into these arrays.

b. Write the definition of the function sumRow that can be used to sum the elements of each row of these arrays. Also write C++ statements that call this function to find the sum of the elements of each row of these arrays.

c. Write the definition of the function print that can be used to output the contents of these arrays. Also write C++ statements that call this function to output the contents of these arrays.

Exercise 2: Write a function called calcStudentAve that takes as its parameters an MxN matrix, an array, and the respective dimensions for each array. Assume that the MxN matrix holds the multiple test scores for each student, the function should calculate the average test score of each student and store each calculated value in the the 1-D array.

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

More Books

Students also viewed these Databases questions