Question: The following sub 1 3 function was implemented by someone who is very evil it ' s supposed to always return ( the input number

The following sub13 function was implemented by someone who is very evilit's supposed to always return (the input number 13). Write a test case using the provided assertTrue function that will discover the error (i.e., fail). Pretend that your code will replace the "FIXME: YOUR CODE HERE" comment. Do not fix the sub13 functionall I want is a test.
#include
#include
#include
using namespace std;
// subtracts 13 from x
int sub13(int x){
if (x %7!=0){
return x -13;
} else if (x >=30 && x <=40){
return x +1234;
} else {
return x -13;
}
}
void assertTrue(bool b, string description){
if (!b){
cout << "FAILED: "<< description << endl;
} else {
cout << "PASSED: "<< description << endl;
}
}
void testCase(){
// FIXME: YOUR CODE HERE
}
int main(){
testCase();
return 0;
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!