Question: 3 ( a ) All Paths Coverage and Control Flow Graphs [ 2 5 marks ] [ 8 marks ] public static Status freeDelivery (

3(a) All Paths Coverage and Control Flow Graphs
[25 marks]
[8 marks]
public static Status freeDelivery
(long rewardPoints, boolean localCustomer)
{
Status rv = Status. INVALID;
long limit = localCustomer ?80:120;
long jumplimit = localCustomer ?20:40;
if ( rewardPoints >0){
if (rewardPoints jumpLimit)
rewardPoints -= limit;
if (rewardPoints > jumpLimit)
rewardPoints -= limit;
rewardPoints jumpLimit );
if (rewardPoints > limit)
rv= Status.FREE_DEL;
else
rv = Status. CHARGE_DEL;
}
return rv;
}
29
30
33..34
32
36..37
35
38..41
Using the all paths coverage and control flow graphs techniques, correctly connect the nodes given in the right-hand side of the above figure. To do so, use the code given in the lefthand side of the above figure.
Correctly answer the following answer to gain the marks
i. What node or nodes are reached from Node (31)?
ii. What node or nodes are reached from Node (33..34)?
iii. What node or nodes are reached from Node (32)?
iv. What node or nodes are reached from Node (36..37)?
(b) Correctly answer the following to gain the marks
 3(a) All Paths Coverage and Control Flow Graphs [25 marks] [8

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 Databases Questions!