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 sub function was implemented by someone who is very evilits supposed to always return the input number Write a test case using the provided assertTrue function that will discover the error ie fail Pretend that your code will replace the "FIXME: YOUR CODE HERE" comment. Do not fix the sub functionall I want is a test.
#include
#include
#include
using namespace std;
subtracts from x
int subint x
if x
return x ;
else if x && x
return x ;
else
return x ;
void assertTruebool b string description
if b
cout "FAILED: description endl;
else
cout "PASSED: description endl;
void testCase
FIXME: YOUR CODE HERE
int main
testCase;
return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
