Answered step by step
Verified Expert Solution
Question
1 Approved Answer
( 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started