Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please Read, no copy paste I need help with a c++ program , I cannot use arrays, linked list only! I don't know how to

Please Read, no copy paste

I need help with a c++ program, I cannot use arrays, linked list only!

I don't know how to read the user input of a matrix, the input is not predefined please don't assign a "userInput[3][3] = {{1 2 3},{4 5 6},{7 8 9}};"

I need to read the user input, and check if that input is correct for a matrix with NxN dimensions if the input is not of a NxN matrix than print an Error

but if the input is a NxN matrix then I need to find the determinant.

I can only use linked list because this is an Sparse Matrix and I cannot assign memory to any zero values

Here is an example of what the user can input into the program, note its only separated by spaces and enter line

User Input Error example:

1 0 0

3 0 0

1 0

Output:

Error! Matrix is not NxN

-------------------------------------------------------------

User Input 1:

-1 0 0

0 -1 0

-1 0 1

Output 1:

The input is a 3x3 matrix, the determinant is 1

-------------------------------------------------------------

User Input 2:

1 0 1 0

1 0 0 0

0 3 0 0

0 0 0 1

Output 2:

The input is a 4x4 matrix, the determinant is 3

-------------------------------------------------------------

User Input 3:

1 0 0

0 1 0

1 0 1

Output 3:

The input is a 3x3 matrix, the determinant is 1

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

More Books

Students also viewed these Databases questions

Question

What is the purpose of the ABC classification system?

Answered: 1 week ago

Question

Identify the different methods employed in the selection process.

Answered: 1 week ago

Question

Demonstrate the difference between ability and personality tests.

Answered: 1 week ago