Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need help on this assignment. It\'s not too difficult based on my understandin

ID: 3566615 • Letter: I

Question

I need help on this assignment. It's not too difficult based on my understanding, although the description is what has me overwhelmed. How do I even initiate this? I understand memory allocation, but have zero idea how to go about making a matrix and so forth. Below is the rubric, any assistance would be IMMENSELY appreciated. keep in mind the program must be in C++ NOT C, we are not allowed to use getch; or headers associated with it as it is deprecated. Thank you for your time!

After the procedure the matrix equation takes the form The unknowns may be found by first finding the nth unknown The remainder may be found by the formula (again in pseudo-code): To test your application, you may use the set of equations Which have the solution x0 = 1, x1 = -1, and x2 = 1 Create a C++ Win32 application that will find the solution to a set of linearly independent equations using Gaussian elimination. Write the application for a set of any number of equations. Prompt the user to input the number of equations in the set of equations. The equations are of the form where the a's and b's are coefficients that are input by the user. The x's are unknowns for which the application will solve. If the set of cannot be solved (because of a division by zero error), the application should display a warning message. A general set of linearly independent equations may be written in the form An algorithm for Gaussian elimination (written in pseudo-code) is as follows: For rows k = 0 to n - 2, assuming akk^(k) not equal to 0 For rows i = k + 1 To n - 1, define the row multipliers

Explanation / Answer

#include<stdio.h>
#include<iostream>

using namespace std;


int main(){
int m=0,n=0,i=0,j=0,k=0;
float pivot=0.0,a=0.0;
float arr[10];
cout << "Enter the number of equations you want to enter : ";
cin >> m;
n=m +1;
float matrix[m][n];
cout << "Enter the equations one by one : (only coefficient) ";
for(i=0;i<m;i++){
for(j=0;j<n;j++){
cin >> matrix[i][j];
}
}
cout << "The equations you entered are : (only coefficient) ";
for(i=0;i<m;i++){
for(j=0;j<n;j++){
printf("%.2f ",matrix[i][j]);
}
cout << " ";
}
for(i=1;i<m;i++){
pivot = matrix[i-1][i-1];
for(j=i;j<m;j++){
a = matrix[j][i-1];
for(k=0;k<n;k++){
matrix[j][k] = matrix[j][k] - (a/pivot)*matrix[i-1][k];
}
}
}
cout << "The Matrix after Gauss elimination is : ";
for(i=0;i<m;i++){
for(j=0;j<n;j++){
printf("%.2f ",matrix[i][j]);
}
cout << " ";
}
arr[m-1]= matrix[m-1][m]/matrix[m-1][m-1];
for(i=m-2;i>=0;i--){
float sum=0.0;
for(j=i;j<m;j++){
sum=sum + matrix[i][j] * arr[j];
}
arr[i] = (matrix[i][m] - sum) / matrix[i][i];
}
cout << "The solution of the equation is : ";
for(i=0;i<m;i++)
{
printf("x%d = %.2f ",(i+1),arr[i]);
}
return 0;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote