Commit 73403fb9 authored by James Knee's avatar James Knee
Browse files

bug fixes

parent 84855a1f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ int labFour_pTwo_exchange(int dollars);
 * @param nn The term in the sequence that is desired, with nn=0 being
 *    the first term.
 * @return the [nn]th number in a Generalized Fibonacci sequence with
 *    filter [filter].
 *    filter [filter]. Rounded to 4 decimal places.
 *
 * @example 1
 * labFour_pThree_genFib({1,1},n) produces the n+4-th Fibonacci numbers:
+13 −9
Original line number Diff line number Diff line
@@ -37,15 +37,15 @@ bool test_labFour_pZero(){
    input1 >> person5;
    input2 >> person6;

    Common::redirIO();
    Common::redirIO("");
    cout << person4;
    string output0 = Common::restoreIO();

    Common::redirIO();
    Common::redirIO("");
    cout << person5;
    string output1 = Common::restoreIO();

    Common::redirIO();
    Common::redirIO("");
    cout << person6;
    string output2 = Common::restoreIO();

@@ -155,7 +155,8 @@ bool test_labFour_pOne(){
        return false;
    }

    if(rh1.getArea() != sqrt(2) / 2){
    float area0 = sqrt(2) / 2.0;
    if(rh1.getArea() != area0){
        cout << "Test 1g failed" << endl;
        return false;
    }
@@ -165,23 +166,26 @@ bool test_labFour_pOne(){
        return false;
    }

    if(c1.getArea() != M_PI){
    float area1 = M_PI;
    if(c1.getArea() != area1){
        cout << "Test 1i failed" << endl;
        return false;
    }

    if(c1.getPerimeter() != 2 * M_PI){
    float perimeter0 = 2 * M_PI;
    if(c1.getPerimeter() != perimeter0){
        cout << "Test 1j failed" << endl;
        return false;
    }

    if(labFour_pOne_GeometricThing::sumAreas(things) != 1 + 2 + 9 + sqrt(2) / 2 + M_PI){
    float sumAreas0 = 1 + 2 + 9 + sqrt(2) / 2.0 + M_PI;
    if(labFour_pOne_GeometricThing::sumAreas(things) != sumAreas0){
        cout << "Test 1k failed" << endl;
        return false;
    }


    if(labFour_pOne_GeometricThing::sumPerimeters(things) != 4 + 6 + 12 + 4 + 2 * M_PI){
    float sumAreas1 = 4 + 6 + 12 + 4 + 2 * M_PI;
    if(labFour_pOne_GeometricThing::sumPerimeters(things) != sumAreas1){
        cout << "Test 1l failed" << endl;
        return false;
    }