Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hints: Arrays and Loops work well together. Arrays and Loops work well together. Arrays and Loops work well together. Here is a refresher on matrix

image text in transcribed

Hints:

Arrays and Loops work well together.

Arrays and Loops work well together.

Arrays and Loops work well together.

Here is a refresher on matrix multiplication: Math is Fun!

Functional Requirements:

Define constants to keep track of the number of ROWS and COLUMNS. Do not prompt the user for what size matrix they want to work with.

Your program should be flexible to work with any number of ROWS and COLUMNS. That is, by changing the values of your ROWS and COLUMNS constants the rest of your program should adjust as appropriate to handle the correct number of elements.

The printing of a matrix will be handled by a function. Since our original matrix is NxM, our entire program will need three different functions to print all the different matrices. Why is this so?

Please write a program with C++ and follow all directions and requirements.

For this lab, your task is to first define a NxM matrix (e.g. two-dimensional array). Then you should prompt the user to enter the values for the matrix. (i.e. declare N and M, or more clearly stated your ROWS and COLUMNS as constants at the beginning of your program) Your program should be able to work with an values of N and M Once the user has entered in all the values, print the matrix back to the user. Be sure to align the values so the matrix is easily readable by the user. Now define a new matrix of size MxN to represent the transpose. Store the transpose of the user's matrix and then print the transposed matrix to the user. Now for the math magic. Define a third matrix of size NxN. This will represent the product of the matrix times its transpose. Compute this product and print the resulting matrix to the user An example run with output is shown below: Welcome to the Matrix Calculator! Please enter a 4x3 matrix: Enter Row 1 Column 1: 5 Enter Row 1 Column 2: 5 Enter Row 1 Column 3: 5 Enter Row 2 Column 1: 1 Enter Row 2 Column 2: 2 Enter Row 2 Column 3: 3 Enter ROw 3 Column 1: 18 Enter Row 3 Column 2: 2 Enter Row 3 Column 3: 4 Enter ROw 4 Column 1: 2 Enter ROw 4 Column 2: 2 Enter ROw 4 Column 3: 2 The matrix you entered is: 5 5 51 1 2 3 10 2 4 2 2 2] The transpose of the matrix is: 5 1 10 2 5 2 2 2 5 3 4 2 The product of the matrix times its transpose is: 75 30 80 3e 30 14 26 12 80 26 120 32 30 12 32 12 Have a nice day

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Records And Database Management

Authors: Jeffrey R Stewart Ed D, Judith S Greene, Judith A Hickey

4th Edition

0070614741, 9780070614741

More Books

Students also viewed these Databases questions

Question

Describe the patterns of business communication.

Answered: 1 week ago

Question

3. Provide two explanations for the effects of mass media

Answered: 1 week ago