Page 1 of 1

Question 1 (10 Marks) This is an incomplete C++ program that allows a user to enter 9 integer numbers to be filled into

Posted: Sat Nov 27, 2021 2:21 pm
by answerhappygod
Question 1 10 Marks This Is An Incomplete C Program That Allows A User To Enter 9 Integer Numbers To Be Filled Into 1
Question 1 10 Marks This Is An Incomplete C Program That Allows A User To Enter 9 Integer Numbers To Be Filled Into 1 (231.03 KiB) Viewed 127 times
Question 1 10 Marks This Is An Incomplete C Program That Allows A User To Enter 9 Integer Numbers To Be Filled Into 2
Question 1 10 Marks This Is An Incomplete C Program That Allows A User To Enter 9 Integer Numbers To Be Filled Into 2 (49.41 KiB) Viewed 127 times
Question 1 10 Marks This Is An Incomplete C Program That Allows A User To Enter 9 Integer Numbers To Be Filled Into 3
Question 1 10 Marks This Is An Incomplete C Program That Allows A User To Enter 9 Integer Numbers To Be Filled Into 3 (88.16 KiB) Viewed 127 times
Question 1 (10 Marks) This is an incomplete C++ program that allows a user to enter 9 integer numbers to be filled into a matrix of size of 3*3. First, it prompts the user to enter any integer numbers and store into the respective element of the array. It then displays the original matrix on the screen by calling a displayMatrix (...) function. It then calls another function transposedMatrix (...) to transpose the matrix and display the matrix again using the displayMatrix (...) function. Lastly, it calls calculateTotal (...) function to compute the total of all 9 integers in the matrix and display the total. The sample output is as below: Sample Output Please enter any 9 integers for the first matrix : Enter an integer into [0][0] : 7 Enter an integer into [0][1] : 5 Enter an integer into [0] [2] : 9 Enter an integer into [1][0] : 12 Enter an integer into [1][1] : 6 Enter an integer into [1] [2] : 5 Enter an integer into [2][0] : Enter an integer into [2] [1] : Enter an integer into [2] [2] : 3

The original matrix is: 759 12 6 5 4 93 The transposed matrix is: 7 12 4 5 6 9 9 5 3 The total of the matrix is 60 Note: Yellow color indicates the user key in value.

i. Prompt user to enter 9 integer numbers to fill in the 3x3 matrix. [2 marks] ii. Write a displayMatrix(...) function to display all elements in the matrix. [2 Marks) iii. Write a transposedMatrix(...) function to transpose the matrix. [3 Marks) iv. Write a calculateTotal(...) function to compute the total of the matrix. [3 Marks]