2D Assignment
15 points
The objective of this assignment is to use 2D arrays in C++.
Your program must conform to these stringent guidelines. You are
to
- declare 2 matrices of size 100 in the main and initilize them (see below)
- pass both matrices by VALUE to a function to multiply them
- the main is to print the result of the multiplied matrices.
Matrix 1:
5 | 9 | 13 | 17 | 21 | 25 | 29 | 33 | 37 | 41 | ... |
6 | 10 | 14 | 18 | 22 | 26 | 30 | 34 | 38 | 42 | ... |
7 | 11 | 15 | 19 | 23 | 27 | 31 | 35 | 39 | 43 | ... |
8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | ... |
9 | 13 | 17 | 21 | 25 | 29 | 33 | 37 | 41 | 45 | ... |
10 | 14 | 18 | 22 | 26 | 30 | 34 | 38 | 42 | 46 | ... |
11 | 15 | 19 | 23 | 27 | 31 | 35 | 39 | 43 | 47 | ... |
12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | ... |
13 | 17 | 21 | 25 | 29 | 33 | 37 | 41 | 45 | 49 | ... |
14 | 18 | 22 | 26 | 30 | 34 | 38 | 42 | 46 | 50 | ... |
... |
104 |
108 |
112 |
116 |
120 |
124 |
128 |
132 |
136 |
140 |
... |
Matrix 2:
1 | 4 | 9 | 16 | 25 | 36 | 49 | 64 | 81 | 100 | ... |
2 | 8 | 18 | 32 | 50 | 72 | 98 | 128 | 162 | 200 | ... |
3 | 12 | 27 | 48 | 75 | 108 | 147 | 192 | 243 | 300 | ... |
4 | 16 | 36 | 64 | 100 | 144 | 196 | 256 | 324 | 400 | ... |
5 | 20 | 45 | 80 | 125 | 180 | 245 | 320 | 405 | 500 | ... |
6 | 24 | 54 | 96 | 150 | 216 | 294 | 384 | 486 | 600 | ... |
7 | 28 | 63 | 112 | 175 | 252 | 343 | 448 | 567 | 700 | ... |
8 | 32 | 72 | 128 | 200 | 288 | 392 | 512 | 648 | 800 | ... |
9 | 36 | 81 | 144 | 225 | 324 | 441 | 576 | 729 | 900 | ... |
10 | 40 | 90 | 160 | 250 | 360 | 490 | 640 | 810 | 1000 | ... |
. . . |
100 |
400 |
900 |
1600 |
2500 |
3600 |
4900 |
6400 |
8100 |
10000 |
... |
SUBMISSION:
- Submit your code with the constant reset to 10 (not 100)
- Please use this code that prints the
a part of the complete answer for the 100x100. This code prints the upper left
10x10 and the lower right 10x10 of the answer
matrix.
-
Place both your code (cpp file ) and output (txt file) in the MatrixMult
drop box,
<\ol>
Output Samples