subject

A dynamic integer matrix is a two dimensional array of integers. It can also be described as a pointer to a pointer or an array of pointers. In this program you will write several small utility functions to test mastery of this concept. The function signatures and descriptions are given below. You may assume that the matrix will be a square matrix meaning that the number of rows equals the number of columns in the matrix.
Implement these functions:
i n t∗∗makeMatrix ( i n t n ) ;
v o i d p r i n t M a t r i x ( i n t∗∗A, i n t n ) ;
b o o l sumEqual ( i n t∗∗A, i n t∗∗B , i n t n ) ;
b o o l i s E q u a l ( i n t∗∗A, i n t∗∗B , i n t n ) ;
i n t d i a g o n a l ( i n t∗∗A, i n t n ) ;
i n t∗∗sumMatrix ( i n t∗∗A, i n t∗∗B , i n t n ) ;
i n t∗∗p r o d u c t ( i n t∗∗A, i n t∗∗B , i n t n ) ;
i n t∗∗s u b t r a c t M a t r i x ( i n t∗∗A, i n t∗∗B , i n t n ) ;
NEXT TWO ARE EXTRA CREDIT AND NOT REQUIRED
d o u b l e∗∗i n v e r s e M a t r i x ( i n t∗∗A, i n t n ) ;
d o u b l e∗∗m a t r i x D i v i s i o n ( i n t∗∗A, i n t∗∗B , i n t n ) ;
Please read the description of these functions carefully.
The makeMatrix function dynamically allocates memory for an integer matrix of size n. It prompts the user to enter values for each position of the matrix from left to right row by row, then returns the created matrix. The printMatrix function displays the matrix from its argument row by row legibly enough so that a grader can see the numbers corresponding to each position of the matrix. The sumEqual function takes two matrices of equal size and an integer indicating the size of the matrices. It computes the sum of all elements in each matrix and see if the sum of each matrix is equal to one another. The function returns true if the sums are equal or returns false if the sums are not equal to one another. You may want to use the enumerated type named "bool" that has only two values: true and false. It is defined in the stdbool. h header file. Function takes two matrices and an integer indicating the size of both matrices.
The isEqual function checks each matrix element by element and see if each element of matrix A is equal to its corresponding element in matrix B. It returns true if the two matrices are element-wise qual or false if even one element is not equal to its corresponding element in the other matrix. You may want to use the enumerated type named "bool" that has only two values: true and false. It is defined in the stdbool. h header file. Function takes two matrices and an integer indicating the size of both matrices.
The diagonal function calculates the product of the elements along the diagonal of the matrix and returns that number. Function takes a single matrix and an integer indicating the size of the matrix. It returns the product.
The sumMatrix function computes the sum of the two matrices. Note that the matrix sum is done element by element in the two matrices. Function takes two matrices and and an integer indicating the size of both matrices. It returns reference to a new dynamic matrix that contains the element by element sum for the corresponding positions.
The product function computes the matrix product by multiplying two matrices. It takes two matrices and an integer indicating the size of both matrices. It returns reference to a new dynamic matrix that is the result of matrix multiplication.
The subtractMatrix function computes the difference of two matrices. The function take two matrices and an integer indicating the size of both matrices. It returns reference to a new dynamic matrix containing the element-wise subtraction.
Your main function should operate similar to the array problem in the last homework assignment. Meaning it will first prompt the user for a size value to be used for both matrices then allow data for them to be entered (by using the makeMatrix function).

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 19:20
Consider the following code snippet: #ifndef cashregister_h#define cashregister_hconst double max_balance = 6000000.0; class cashregister{public: cashregister(); cashregister(double new_balance); void set_balance(double new_balance); double get_balance() const; private: double balance[12]; }; double get_monthly_balance(cashregister bk, int month); #endifwhich of the following is correct? a)the header file is correct as given.b)the definition of max_balance should be removed since header files should not contain constants.c)the definition of cashregister should be removed since header files should not contain class definitions.d)the body of the get_monthly_balance function should be added to the header file.
Answers: 1
question
Computers and Technology, 22.06.2019 22:30
You are new to microsoft certification and want to start out by getting a certification geared around windows 8. what microsoft certification should you pursue?
Answers: 1
question
Computers and Technology, 23.06.2019 06:20
Which text function capitalizes the first letter in a string of text? question 10 options: upper capital first proper
Answers: 1
question
Computers and Technology, 23.06.2019 12:00
If you embed a word table into powerpoint, what happens when you make edits to the embedded data? a. edits made to embedded data change the data in the source file; however, edits made to the source file will not be reflected in the embedded data. b. edits made to embedded data will change the data in the source file, and edits made to the source file will be reflected in the embedded data. c. edits made to embedded data don't change the data in the source file, nor will edits made to the source file be reflected in the embedded data. d. edits made to embedded data don't change the data in the source file; however, edits made to the source file will be reflected in the embedded data.
Answers: 1
You know the right answer?
A dynamic integer matrix is a two dimensional array of integers. It can also be described as a point...
Questions
question
Mathematics, 19.05.2021 22:20
question
Computers and Technology, 19.05.2021 22:20
question
Mathematics, 19.05.2021 22:20
Questions on the website: 13722367