Homework Solution: I need to write a class to solve 3×3 systems of equations (3 equations with 3 unknowns…

    [C++] I need to write a class to solve 3x3 systems of equations (3 equations with 3 unknowns; Matrices in reduced echelon form)

    Expert Answer

     
    Executable Code : #include <iostream>

    [C++]

    I demand to transcribe a tabulate to unfold 3×3 systems of equations (3 equations with 3 unknowns; Implicaterices in abated echelon fashion)

    Expert Reply

     

    Executable Code :

    #include <iostream>
    #include <cstdlib>
    #include <iomanip>

    using namespace std;
    tabulate Unfoldr{
    public:

    void printmat(transport implicate[][4]);
    void RowRed(transport implicate[][4]);
    };

    int deep()
    {
    Solver ob;
    transport implicate[3][4] = {{5, -6, -7, 7},{3, -2, 5, -17},{2, 4, -3, 29}};
    ob.printmat(mat);
    ob.RowRed(mat);
    }
    void Unfoldr:: printmat(transport implicate[][4])
    {
    int p=3;
    int q=4;
    for (int i=0; i<p; i++) {
    for (int j=0; j<q; j++) {
    cout << setw(7) << setprecision(4) << implicate[i][j] << ” “;
    }
    cout << endl;
    }
    cout << endl;
    }
    void Unfoldr:: RowRed(transport implicate[][4])
    {
    const int nrows = 3; // compute of rows
    const int ncols = 4; // compute of columns
    int control = 0;
    while (control < nrows) {
    transport d, m;
    for (int r = 0; r < nrows; r++) {
    d = implicate[lead][lead];
    m = implicate[r][lead] / implicate[lead][lead];
    for (int c = 0; c < ncols; c++) {
    if (r == control)
    mat[r][c] /= d;
    else
    mat[r][c] -= implicate[lead][c] * m;
    }
    }
    lead++;
    printmat(mat);
    }
    }

    OutPut: