Question: Write a program that asks the user for the number of linear equations to solve (lets say n
Write a program that asks the user for the number of linear equations to solve (lets say n <=10) using the the Gaussian elimination with scaled partial pivoting method. Ask the user to first enter the number of equations and then give them the choice to enter the coefficients from the command line (by asking for each row that includes the b value) or have them enter a file name which has the augmented coefficient matrix (including the b values) in a simple text file format as seen below for an example of 3 equations :
E.g. the contents of a file for 3 linear equations 2x+3y = 8, -x+2y-z=0, 3x+2z=9 will be
2 3 0 8
-1 2 -1 0
3 0 2 9
Your program should output the scaled ratios at each step, and mention the pivot row selected based on the scaled ratio. Show the intermediate matrix at each step of the Gaussian Elimination process. Finally, the final output of your program should be the solution in the following format :
x=1
y=2
z=3
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
