C++ Code, Function below is not a member function of Sequence class:
voidsubtractX(Sequenceint>& s,int& x) //! updates s //! clears x //! ensures: s = #s with all corresponding values of s reduced by value in #x {for(intk = 0, z = s.length(); k < z;="" k++)="" {="" s1.1,="" s1.2,="" s1.3,="">inty; s.remove(k, y); // s2 y -= x; // s3 s.add(k, y); // s4 } // end for x.clear(); // s5 } // END subtractX
For the function above,
a. Draw the code diagrams with labels for statements and branches.
b. Provide test cases for statement, branch, and path coverages (properly identifying all the test cases with correct labels and the respective function).
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here