COMP 218 -- Object-Oriented Programming
students are expected to write, run, test, and debug a fully-working C++ program for the following computing problem:
In mathematics, a matrix is a rectangular array of numbers, arranged in rows and columns. For example, the dimension of the below matrix is 2 x 3 (read “two by three”), because there are two rows and 3 columns:
𝐴 = [ 1 2 −1]
−1 0 3
Matrices can be called sparse or dense depending on the number of zero elements. A sparse matrix is a matrix in which most of the elements are zero. By contrast, if most of the elements are nonzero, then the matrix is considered dense. For dense matrices, all values need to be stored in the system. However, for sparse matrices, since the number of non-zero values is less, instead of unnecessarily occupying memory for zero values, we may store the corresponding row and column information of the non-zero values in the system. To be more specific, for a dense matrix, every cell of the matrix needs to occupy memory, however, for a sparse matrix, only row, column, and value information needs to be stored.
Both sparse and dense matrices are to be derived from the general matrix class. The general matrix class should contain a couple of pure virtual functions, namely, the get, set, and resize, to be overridden by the sparse/dense matrices to meet their specific needs. Also note that, for a sparse matrix, get function needs to apply a kind of search operation since we are not storing the whole n x m system.
Some mathematical operations that need to be defined are the matrix addition, subtraction, and multiplication. Matrix transpose, multiplying by a constant, and testing whether two matrices commute (equal) or not, are the other functions that should be defined. Moreover, inputting and outputting of the matrices should be presented in such a way that a user may specify values into the matrices. Remember, when possible, operator functions need to be overloaded.
Partial grading will be applied in case there is no full implementation.
DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma
Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t
Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th
1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of
1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of