Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

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
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions