
Postlab Activities
Exercise 1: Lesson 11, Postlab Exercise 8 asked you to implement a matrix with the
following functions for a 5-by-4 matrix. Rewrite this program as a template class,
where the template argument is either an int or a float.
Add Takes two matrices (A and B) as input and returns a matrix (Result) in
which each position is the sum of the corresponding positions in A and B.
Sub Takes two matrices (A and B) as input and returns a matrix (Result) in
which each position is the corresponding position in A minus the
corresponding position in B.
Write Takes a file name and a matrix as input and writes the matrix by row, one
row per line on the ...