Question: ( b ) Consider the following code: 0 1 . float evaluateFitness ( float absBallAngle , float ballDistance, bool isStriker ) { 0 2 .
b Consider the following code:
float evaluateFitnessfloat absBallAngle float ballDistance,
bool isStriker
if ballDistance
if absBallAngle
return ;
else
return absBallAngle ;
else
if ballDistance
return ;
else
return ballDistance ;
i Sketch a control flow graph for the code given. Label each node
uniquely by line number where possible so that it can be easily
matched to the corresponding code.
ii Write down all independent paths through the code.
iii Calculate the decision coverage of a test in which ballDistance is
and absBallAngle is
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
