Question: Belows are the function declarations using pointers. Please use the exact name and format as it shows here. Write a collection of functions that operates
Belows are the function declarations using pointers. Please use the exact name and format as it shows here.
Write a collection of functions that operates on a two- dimensional matrix (a global variable) with ROW_SIZE rows and COL_SIZE columns. The main function should provide calls to each of the functions and display the results. The functions should have the following declarations:
1. Name your header file as TwoDArray.h. Include the following functions declaration in your header file.
2. Name your implementation file as TwoDArray.cpp.
// *the_array is a two dimensional array; row_num is the row size ; col_size is column size; row_vals is the new the row
void set_row(double *the_array , int row_num, int col_size, double *row_vals); // Stores the array of row_ vals in row
// return a row of two-dimensional array by row number. double* get_row(double *the_array, int row_num, int col_size); // Returns the specified row from a two dimensional array
// set a value in a two-dimensional array by row and column number void set_element( double *the_array, int row_num, int col_size, int col_num, double val); // Sets the specified element
// return a value from a two-dimensional array by row and column number. double get_element(double *the_array, int row_num, int col_size, int col_num); // Returns the specified element double sum(double *the_array, int row_size, int col_size); // Returns sum of the values in the array double find_max(double *the_array, int row_size, int col_size); // Returns the largest value in the array double find_min(double *the_array, int row_size, int col_size); // Returns the smallest value in the array string to_string(double *the_array, int row_size, int col_size); // Returns a string representing the matrix
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
