Implement 4 versions of a matrix program and write a driver to test 3 different operations with matrices. The matrix operations that you should include are Addition, Subtraction and Multiplication. The driver can be as simple as asking the user to enter two matrices and then presenting a simple menu that allows the user to select the operation they want to test. Have the menu in a loop so that the user can test any other operation unless they choose to exit the menu. Also, provide the user an option to select two new matrices. Make sure that the result of every operation is printed out after the operation is chosen. The matrices should hold float values, so please use float data types in all versions.
1. C/C++ version that uses a regular 2D array for representing the matrix. Limit the size of array to 100x100. Add appropriate functions to do the operations of addition, subtraction and multiplication of two matrices.
2. C/C++ version that uses a pointer to a pointer (**p) that is allocated memory using new to create the 2D matrix. Provide 3 functions, one for addition, subtraction and multiplication respectively, that take in the two matrices and return the result back (as a pointer to a pointer)
3. C/C++ version that uses a pointer to a pointer as a private data in a class called matrix (create this class) and add overloaded operator functions (+ for addition, - for subtraction and * for multiplication) to the class for doing the matrix operations.
4. Create a Java Class called matrix and uses arrays and add appropriate methods for the matrix operations.
Also test the multiplication function of each version by multiplying the same two matrices (say of size 10x10) and comment on the time taken to do the multiplication.
For the last two versions, what happens to the time taken for multiplication as you start increasing the size of the matrices that you are multiplying. You can populate the matrices by random numbers.
Create a report(.doc) that talks about the comparison between the 4 versions as well as the timing of using the class version matrices in C++ vs. the version in Java. Comment on any other aspects of comparison of these 4 versions. Comment on the time taken to complete the multiplication as the size of matrices increases. You can also compare versions 2 and 3.