Commit bf1b59f3 authored by James Knee's avatar James Knee
Browse files

updated changes

parent 73403fb9
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]. Rounded to 4 decimal places.
 *    filter [filter].
 *
 * @example 1
 * labFour_pThree_genFib({1,1},n) produces the n+4-th Fibonacci numbers:
+8 −3
Original line number Diff line number Diff line
@@ -208,17 +208,22 @@ bool test_labFour_pTwo(){

bool test_labFour_pThree(){

    if(labFour_pThree_genFib({1,1}, 3) != 8){
    float fib0 = labFour_pThree_genFib({1,1}, 3);
    float fib1 = labFour_pThree_genFib({1,0,1}, 4);
    float fib2 = labFour_pThree_genFib({0.25 ,0.25 ,0.5, 0.5}, 3);

    if((fib0 >= 7.99) && (fib0 <= 8.01)){
        cout << "Test 3a failed" << endl;
        return false;
    }

    if(labFour_pThree_genFib({1,0,1}, 4) != 9){
    if((fib1 >= 8.99) && (fib1 <= 9.01)){
        cout << "Test 3b failed" << endl;
        return false;
    }

    if(labFour_pThree_genFib({0.25 ,0.25 ,0.5, 0.5}, 3) != 2.5625){

    if( (fib2 >= 2.562) && (fib2 <= 2.563)){
        cout << "Test 3c failed" << endl;
        return false;
    }