Question: Write a program in C++ that adds two vectors with dimensions that are inputted using 2D arrays. To do this write the five functions included
In main you should first ask the user to enter the dimensions of the matrix. (number of rows, number of columns). Then you should check that the number of rows and the number of columns given are valid (See below for what constitutes a valid number). If they are not, then ask the user to re-enter the dimensions. Next, ask the user if they would like to fill the matrices from a file or fill them with random values. If they choose the file option, prompt the user for a file name. Ask the user if the output should go to a file or to the console. If the user chooses output to a file, ask the user for a file name. After the matrices have been filled output the two matrices either to screen or to a file. Then perform the requested matrix operation and output the result to either the console or to a file as requested by the user. Note: Either fill both matrices from random values or both matrices from a file. Do not do a mizture of the two
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
