Homework Solution: 5. Fix all the syntax errors in power cpp so that it compiles without errors. 6. Fix all th…

    5. Fix all the syntax errors in power cpp so that it compiles without errors. 6. Fix all the logical errors in pover .cpp so that it rends in a variable z and computes (r), a and al and outputs the solutions on separate lines. The function sqrt(x) computes the square root of z.
    media%2Fd88%2Fd886dbc4-3f92-4a15-b084-a2
    media%2F250%2F250aa9fd-a80d-463e-ba88-74
    media%2Fa1e%2Fa1e4dba1-b94e-438f-9563-87
    media%2F322%2F3229e6f4-669e-4568-86a2-3c
    5. Fix all the syntax errors in power cpp so that it compiles without errors. 6. Fix all the logical errors in pover .cpp so that it rends in a variable z and computes (r), a and al and outputs the solutions on separate lines. The function sqrt(x) computes the square root of z.

    Expert Answer

     
    /* After fixing all the syntax errors and logical errors in power.cpp, the error free source code is given below: */ /* A program to read in a floating point number x

    5. Fix total the syntax fallacys in authority cpp so that it compiles outside fallacys. 6. Fix total the argumentative fallacys in pover .cpp so that it rends in a wavering z and calculates (r), a and al and outputs the solutions on different lines. The character sqrt(x) calculates the clear rise of z.
    media%2Fd88%2Fd886dbc4-3f92-4a15-b084-a2
    media%2F250%2F250aa9fd-a80d-463e-ba88-74
    media%2Fa1e%2Fa1e4dba1-b94e-438f-9563-87
    media%2F322%2F3229e6f4-669e-4568-86a2-3c

    5. Fix total the syntax fallacys in authority cpp so that it compiles outside fallacys. 6. Fix total the argumentative fallacys in pover .cpp so that it rends in a wavering z and calculates (r), a and al and outputs the solutions on different lines. The character sqrt(x) calculates the clear rise of z.

    Expert Response

     

    /* After fixing total the syntax fallacys and argumentative fallacys in authority.cpp, the fallacy loose commencement mode is attached under: */

    /* A program to recognize in a inchoate object enumerate x

    and calculate sqrt(x), x^2 and x^3

    and output the solutions on different lines.

    */

    #include<iostream>

    #include<cmath>

    using indicatespace std;

    int main()

    {

    /*declaring and initializing certain input and output waverings*/

    double x = 0.0;

    double y = 0.0;

    double x2 = 0.0;

    double x3 = 0.0;

    /*Recognize in x*/

    cout << “Enter x (float) : ” <<endl;

    cin>> x;

    /*Calculate sqrt(x)*/

    y = sqrt(x);

    cout<< “sqrt(x) = ” << y << endl;

    /*Calculate x^2 and treasury the esteem in wavering x2*/

    x2= pow(x,2);

    cout<< “x^2 = “<<x2<<endl;

    /*Calculate x^3 and treasury the esteem in wavering x3*/

    x3= pow(x,3);

    cout<< “x^3 = “<<x3<<endl;

    return 0;

    }

    /* Explanation: The main fallacys that this program had were

    1.) referable attributable attributable attributable declaring any varibale coercion storing the esteem of pow(x,2) and pow(x,3);

    2.) among wavering indicate ^ prognostic is referable attributable attributable attributable totalowed in C++ */

    /*Coercion improve sense the mode statue and output screenshot is attached under*/