Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C program that is able to view, add, or multiply two matrices input by the user. After inputting the two matrices, the user

Write a C program that is able to view, add, or multiply two matrices input by the user. After inputting the two matrices, the user should be presented with a menu of possible operations View the matrices Add the matrices Multiply the matrices Quit the program The user should be able to make a choice, see the outcome of the operation, and then make another choice from the menu. The program should continue to operate in this manner until the user selects the quit action, at which point the program should exit. 1. Collect user input for two matrices The size of each matrix in rows and columns The data stored in the matrices The user should be able to input up to a 5x5 matrix. Your program should be able to support any size up to a 5x5 (e.g. 2x3, 1x2, 4x4, 5x3, etc). The matrices should hold double type floating point numbers and be stored in a single or multidimensional array. 2. Display a menu of available options that includes, at least, the following View the matrices Add the matrices Multiply the matrices Quit the program The program should loop indefinitely until the user selects the option to quit. Each time an operation is selected, your program should perform the selected operation, display the results, and then present the user with the menu again. 3. The results of the performed operation should only be displayed and not stored, meaning they should not affect the values of the matrices input by the user. Thus performing the same operation repeatedly will return the same results. 4. Before performing an operation, you must ensure that the operation is valid. If the user has input matrices which are not compatible with the selected operation, print an error message indicating the problem and then present them with the menu again. Do not simply quit the program.

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_2

Step: 3

blur-text-image_3

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

Bioinformatics Databases And Systems

Authors: Stanley I. Letovsky

1st Edition

1475784058, 978-1475784053

More Books

Students also viewed these Databases questions

Question

Summarize what can be done to encourage ethical communication.

Answered: 1 week ago

Question

1. How will you, as city manager, handle these requests?

Answered: 1 week ago