Write a program that asks user for number of linear equation


Problem

In C++ or Java

Write a program that asks the user for the number of linear equations to solve (let's say n <=10) using the Gaussian elimination with the 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 that has the augmented coefficient matrix (including the b values) in a simple text file format as seen below for an example of 3 equations :

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

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Write a program that asks user for number of linear equation
Reference No:- TGS03242113

Expected delivery within 24 Hours