Loading tests/extraTestsProb1.cpp +11 −11 Original line number Diff line number Diff line Loading @@ -139,41 +139,41 @@ float test_1e() { setTotal(40); bool case0 = makeTotalQ(102, 8, 3, 43);//True 3 * 8 * 102 % 43 = 40 bool case1 = makeTotalQ(5, 4, 2, 0);//True 5 * 4 * 2 + 0 = 40 bool case2 = makeTotalQ(5, 4, 2, 0); //False bool case2 = makeTotalQ(3, 6, 3, 3); //False setTotal(56); bool case3 = makeTotalQ(1022, 8, 12, 1752);//True (12 * 8 * 1022) / 1752 = 24 bool case4 = makeTotalQ(28, 2, 4, 0);// (28 / 2) * 4 + 0 = 56 bool case5 = makeTotalQ(28, 2, 4, 0);//False bool case5 = makeTotalQ(2, 4, 2, 1);//False if(!case0){ cout << "-1: makeTotalQ(102, 8, 3, 43) = true(3 * 8 * 102 % 43 = 40), but your function returned makeTotalQ(102, 8, 3, 43) = false" << endl; cout << "-1: makeTotalQ(102, 8, 3, 43) = 40 -> true(3 * 8 * 102 % 43 = 40), but your function returned makeTotalQ(102, 8, 3, 43) = false" << endl; total -= 1; } if(!case1){ cout << "-1: makeTotalQ(5, 4, 2, 0) = true(5 * 4 * 2 + 0 = 40), but your function returned makeTotalQ(5, 4, 2, 0) = false" << endl; cout << "-1: makeTotalQ(5, 4, 2, 0) = 40 -> true(5 * 4 * 2 + 0 = 40), but your function returned makeTotalQ(5, 4, 2, 0) = false" << endl; total -= 1; } if(case2){ cout << "-1: makeTotalQ(5, 4, 2, 0) = false, but your function returned makeTotalQ(5, 4, 2, 0) = true" << endl; cout << "-1: makeTotalQ(3, 6, 3, 3) = 40 -> false, but your function returned makeTotalQ(3, 6, 3, 3) = true" << endl; total -= 1; } if(!case3){ cout << "-2: makeTotalQ(1022, 8, 12, 1752) = true((12 * 8 * 1022) / 1752 = 24), but your function returned makeTotalQ(1022, 8, 12, 1752) = false" << endl; total -= 2; cout << "-1: makeTotalQ(1022, 8, 12, 1752) = 56 -> true((12 * 8 * 1022) / 1752 = 24), but your function returned makeTotalQ(1022, 8, 12, 1752) = false" << endl; total -= 1; } if(!case4){ cout << "-2: makeTotalQ(28, 2, 4, 0) = true((28 / 2) * 4 + 0 = 56), but your function returned makeTotalQ(28, 2, 4, 0) = false" << endl; total -= 2; cout << "-1: makeTotalQ(28, 2, 4, 0) = 56 -> true((28 / 2) * 4 + 0 = 56), but your function returned makeTotalQ(28, 2, 4, 0) = false" << endl; total -= 1; } if(case5){ cout << "-2: makeTotalQ(28, 2, 4, 0) = false, but your function returned makeTotalQ(28, 2, 4, 0) = true" << endl; total -= 2; cout << "-1: makeTotalQ(28, 2, 4, 0) = 56 -> false, but your function returned makeTotalQ(28, 2, 4, 0) = true" << endl; total -= 1; } return total; Loading Loading
tests/extraTestsProb1.cpp +11 −11 Original line number Diff line number Diff line Loading @@ -139,41 +139,41 @@ float test_1e() { setTotal(40); bool case0 = makeTotalQ(102, 8, 3, 43);//True 3 * 8 * 102 % 43 = 40 bool case1 = makeTotalQ(5, 4, 2, 0);//True 5 * 4 * 2 + 0 = 40 bool case2 = makeTotalQ(5, 4, 2, 0); //False bool case2 = makeTotalQ(3, 6, 3, 3); //False setTotal(56); bool case3 = makeTotalQ(1022, 8, 12, 1752);//True (12 * 8 * 1022) / 1752 = 24 bool case4 = makeTotalQ(28, 2, 4, 0);// (28 / 2) * 4 + 0 = 56 bool case5 = makeTotalQ(28, 2, 4, 0);//False bool case5 = makeTotalQ(2, 4, 2, 1);//False if(!case0){ cout << "-1: makeTotalQ(102, 8, 3, 43) = true(3 * 8 * 102 % 43 = 40), but your function returned makeTotalQ(102, 8, 3, 43) = false" << endl; cout << "-1: makeTotalQ(102, 8, 3, 43) = 40 -> true(3 * 8 * 102 % 43 = 40), but your function returned makeTotalQ(102, 8, 3, 43) = false" << endl; total -= 1; } if(!case1){ cout << "-1: makeTotalQ(5, 4, 2, 0) = true(5 * 4 * 2 + 0 = 40), but your function returned makeTotalQ(5, 4, 2, 0) = false" << endl; cout << "-1: makeTotalQ(5, 4, 2, 0) = 40 -> true(5 * 4 * 2 + 0 = 40), but your function returned makeTotalQ(5, 4, 2, 0) = false" << endl; total -= 1; } if(case2){ cout << "-1: makeTotalQ(5, 4, 2, 0) = false, but your function returned makeTotalQ(5, 4, 2, 0) = true" << endl; cout << "-1: makeTotalQ(3, 6, 3, 3) = 40 -> false, but your function returned makeTotalQ(3, 6, 3, 3) = true" << endl; total -= 1; } if(!case3){ cout << "-2: makeTotalQ(1022, 8, 12, 1752) = true((12 * 8 * 1022) / 1752 = 24), but your function returned makeTotalQ(1022, 8, 12, 1752) = false" << endl; total -= 2; cout << "-1: makeTotalQ(1022, 8, 12, 1752) = 56 -> true((12 * 8 * 1022) / 1752 = 24), but your function returned makeTotalQ(1022, 8, 12, 1752) = false" << endl; total -= 1; } if(!case4){ cout << "-2: makeTotalQ(28, 2, 4, 0) = true((28 / 2) * 4 + 0 = 56), but your function returned makeTotalQ(28, 2, 4, 0) = false" << endl; total -= 2; cout << "-1: makeTotalQ(28, 2, 4, 0) = 56 -> true((28 / 2) * 4 + 0 = 56), but your function returned makeTotalQ(28, 2, 4, 0) = false" << endl; total -= 1; } if(case5){ cout << "-2: makeTotalQ(28, 2, 4, 0) = false, but your function returned makeTotalQ(28, 2, 4, 0) = true" << endl; total -= 2; cout << "-1: makeTotalQ(28, 2, 4, 0) = 56 -> false, but your function returned makeTotalQ(28, 2, 4, 0) = true" << endl; total -= 1; } return total; Loading