Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The assignment In this assignment you will take the Matrix addition and subtraction code and modify it to utilize the following 1. Looping user input

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

The assignment In this assignment you will take the Matrix addition and subtraction code and modify it to utilize the following 1. Looping user input with menus in an AskUserinput function a. User decides which operation to use (add, subtract) on MatrixA and MatrixB b. User decides what scalar to multiply MatrixC by c. User can complete more than one operation or cancel. Please select the matrix operation 1- Matrix Addition A+ B 2-Matrix Subtraction A-B 3Scalar Multiplication sC 4-Cancel and Exit User Interface Please select the matzix operation 1 -Hatrix Addition + B 2-Matrix Subtraction AB 3 - Scalar Multiplication s * C 4-Cancel and Exit Please entez an integer scalar value User Interface when 3 is chosen 2. Error checking for user inputs, file open/close. Tell them their input is incorrect, and loop until they get it right or cancel. If the file is not there, tell the user the file is missing. 3. You will create a new functions, MatrixAddition() and MatrixScalarMultiplication) a. Inside Matrix Addition you will move the code necessary for addition. b. Inside Matrix Scalar Multiplication, you need to add the code necessary for scalar multiplication on only Matrix C. (see below) 4. Scalar Multiplication of MatrixC and a user input integer scalar value. The scalar multiplication output should be handled similar to the addition and subtraction. MatrixC Scalar MatrixC To find 2A, simply multiply each matrix entry by 2: 10 6 2.10 2 6 24 2.3 20 12 Output format for scalar multiplication: (Note, the user can enter ANY positive integer for the scalar) Matrix Scalar Multiplication Step 1 Scalar MatrixC Matzix Scalar Multiplication Step 2 ScalarHatri 20 20 2 0 20 20 2*0 20 20202 20 20 2 020 20 20 20 2*020 20 2020202020 Matrix Scalar Multiplication Step 3 10 6. You must close the file when the user decides to exit the program. Extra Credit 1. 2. You will create a new function called MatrixDirectSum0) You will need to add an option in the user input to use this matrix manipulation a11... aln 00 aml amn 0 0...0b1 0 B bpg For instance 0 0 0 1 6 0 0 0 0 1 Since C does not have a symbol for the direct sum, use (+) instead. printf" (+)"//do not copy and paste this code. Write it yourself

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

Pro SQL Server Wait Statistics

Authors: Enrico Van De Laar

1st Edition

1484211391, 9781484211397

More Books

Students also viewed these Databases questions