diff --git a/problems/LabFour_ChapterTen.h b/problems/LabFour_ChapterTen.h index 08c44f50c3fb84030c764d39bcdfd61e4d9996a4..7c484e0a05ac4721623e4ad66b8abd6847fe7f9c 100644 --- a/problems/LabFour_ChapterTen.h +++ b/problems/LabFour_ChapterTen.h @@ -58,7 +58,7 @@ class labFour_pZero_Instructor; * labFour_pOne_Rhombus rh1({1, 1}, 1, 45); // area sqrt(2)/2, perimeter 4 * labFour_pOne_Circle c1({0, 0}, 1); // area pi, perimeter 2*pi * - * vector things = {&re1, &s1, &rh1, &c1}; + * vector things = {&q1, &re1, &s1, &rh1, &c1}; * * labFour_pOne_GeometricThing::sumAreas(things); // returns 1+2+9+sqrt(2)/2+pi = 15.8487... * labFour_pOne_GeometricThing::sumPerimeters(things); // returns 4+6+12+4+2*pi = 32.2832... diff --git a/tests/LabFour.cpp b/tests/LabFour.cpp index 66bc043838d4fd5bfc322cca957371bb5ed8e3cd..b24036dd73832f93668e0b8ee271d038c8bbe992 100644 --- a/tests/LabFour.cpp +++ b/tests/LabFour.cpp @@ -123,7 +123,7 @@ bool test_labFour_pOne(){ labFour_pOne_Rhombus rh1({1, 1}, 1, 45); // area sqrt(2)/2, perimeter 4 labFour_pOne_Circle c1({0, 0}, 1); // area pi, perimeter 2*pi - vector things = {&re1, &s1, &rh1, &c1}; + vector things = {&q1, &re1, &s1, &rh1, &c1}; if(q1.getArea() != 1){ cout << "Test 1a failed" << endl; @@ -208,22 +208,22 @@ bool test_labFour_pTwo(){ bool test_labFour_pThree(){ - 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); + 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)){ + if((fib0 <= 7.99) || (fib0 >= 8.01)){ cout << "Test 3a failed" << endl; return false; } - if((fib1 >= 8.99) && (fib1 <= 9.01)){ + if((fib1 <= 8.99) || (fib1 >= 9.01)){ cout << "Test 3b failed" << endl; return false; } - - if( (fib2 >= 2.562) && (fib2 <= 2.563)){ + cout << fib2 << endl; + if( (fib2 <= 2.562) || (fib2 >= 2.563)){ cout << "Test 3c failed" << endl; return false; } diff --git a/tests/Makefile b/tests/Makefile index 3ad1630416a0e93a218bbd80ff74cb3348e886aa..4fb9fc90e494c151bed6f7e6dae21f60f31d06e9 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -10,7 +10,7 @@ LAB0_SRCS = LabZero.cpp lab0.cpp $(COMMON_SRCS) LAB1_SRCS = LabOne.cpp lab1.cpp $(COMMON_SRCS) LAB2_SRCS = LabTwo.cpp lab2.cpp LAB3_SRCS = LabThree.cpp -LAB4_SRCS = LabFour.cpp +LAB4_SRCS = LabFour.cpp $(COMMON_SRCS) # Object files COMM_OBJS = Support/Common.o @@ -18,7 +18,7 @@ LAB0_OBJS = LabZero.o lab0.o $(COMM_OBJS) LAB1_OBJS = LabOne.o lab1.o $(COMM_OBJS) LAB2_OBJS = LabTwo.o lab2.o LAB3_OBJS = LabThree.o -LAB4_OBJS = LabFour.o +LAB4_OBJS = LabFour.o $(COMM_OBJS) OBJS = $(COMM_OBJS) $(LAB0_OBJS) $(LAB1_OBJS) $(LAB2_OBJS) $(LAB3_OBJS) $(LAB4_OBJS) # Executable names