Question
Matrix Operations You are given a 7X7 square matrix and asked to develop C++ program to modify a section of the matrix. MODIFY A SECTION
Matrix Operations
You are given a 7X7 square matrix and asked to develop C++ program to modify a section of the matrix.
MODIFY A SECTION OF THE GIVEN MATRIX
This assignment is about working with two-dimensional arrays in a C++ programming environment. You are given a 7X7 square matrix and asked to develop a C++ program to modify a section of the given matrix by adding an integer number to all values in a selected part of the matrix (a sub-matrix selected by the user).
REQUIREMENTS
-Model the user interface as shown in the screen shot. You should set the distance between the columns within the matrix display on the screen using setw().
-First of all, your program will display the given matrix on the screen. This is to confirm that the given matrix was built properly (your starting point).
-Next, ask the user to enter the integer number to be added to the sub-matrix that they will select. Do not allow the user to enter a floating point number.
-Finally, ask the user to enter the beginning row and column offset and the ending row and column offset to define the sub-matrix that they wish to modify. For example, if the user enters (0, 0) as the beginning offset and (6, 6) as the ending offset, they will select the entire matrix to receive the modification.
-After receiving all five user input parameters, your program will update the matrix by adding the integer value that the user has given to each element in the sub-matrix.
-Display the final matrix after the modification is applied.
-Provide information for programmers about the program sections by placing comments within the program at the beginning of each of the three sections (matrix display, modifications, matrix redisplay).
Original Matrix(Given Matrix):
1 0 2 0 -3 0 4
0 2 0 -3 0 4 0
2 0 -3 0 4 0 -5
0 -3 0 4 0 -5 0
-3 0 4 0 -5 0 6
0 4 0 -5 0 6 0
4 0 -5 0 6 0 7
NOTES NOTE 1: Array values are shown in the screen shot and should be hard-coded into your program. Do not use an input data file.
NOTE 2: Remember to use zero-based offsets to reference array positions.
NOTE 3: You may clear the screen with system("CLS"); if needed.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started