// Matrix operations: give option to user to select which operation to perform. // 1 = doubleMatrix in which each element is // 2 = square -> square each element of matrix // 3 = multiply matrix with...


matrix = {{1,2},{4,5}}


this in c++


// Matrix operations: give option to user to select which<br>operation to perform.<br>// 1 = doubleMatrix in which each element is<br>// 2 = square -> square each element of matrix<br>// 3 = multiply matrix with a constant. Get the constant as input<br>4<br>7<br>from user<br>// You don't need to change initial values in myMatrix<br>// output matrix in correct shape:<br>//<br>8<br>9<br>10<br>11<br>// Sample run:<br>// Enter Operation: 3<br>// Enter constant: 2<br>// 2 4<br>// 8 10<br>12<br>13<br>14<br>15<br>16<br>

Extracted text: // Matrix operations: give option to user to select which operation to perform. // 1 = doubleMatrix in which each element is // 2 = square -> square each element of matrix // 3 = multiply matrix with a constant. Get the constant as input 4 7 from user // You don't need to change initial values in myMatrix // output matrix in correct shape: // 8 9 10 11 // Sample run: // Enter Operation: 3 // Enter constant: 2 // 2 4 // 8 10 12 13 14 15 16
18<br>#include <iostream><br>19<br>#include <vector><br>auto doubleMatrix()<br>{<br>20<br>21<br>22<br>}<br>auto square()<br>{<br>23<br>24<br>25<br>26<br>}<br>auto multiplywithConst()<br>{<br>27<br>28<br>29<br>30<br>}<br>int main()<br>{<br>std::vector<std::vector<int>> myMatrix{{1, 2},{4, 5}};<br>31<br>32<br>33<br>34<br>35<br>36<br>}<br>

Extracted text: 18 #include 19 #include auto doubleMatrix() { 20 21 22 } auto square() { 23 24 25 26 } auto multiplywithConst() { 27 28 29 30 } int main() { std::vector<>> myMatrix{{1, 2},{4, 5}}; 31 32 33 34 35 36 }

Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here