Question: ( a ) All Paths Coverage and Control Flow Graphs. Specification A function, called freeDeliver, for an online food restaurant determines whether a customer gets
a All Paths Coverage and Control Flow Graphs. Specification A function, called freeDeliver, for an online food restaurant determines whether a customer gets a free delivery or not based on reward points to date and whether the customer is a local member or not.
Inputs
rewardPoints: accumulated reward points of a customer
localCustomer: true for a local customer; false otherwise
Outputs
CHARGEDEL if rewardPoints and localCustomer
CHARGEDEL if rewardPoints and localCustomer
FREEDEL if rewardPoints
FREEDEL if rewardPoints and localCustomer
INVALID if rewardPoints
Using the all paths coverage and control flow graphs technique, correctly connect the nodes given in the righthand side of the above figure. To do so use the code given in the lefthand side of the above figure. Keep the same order and place of each node, as shown above, in your answer sheet. Correctly answer the following questions to gain the marks.
I. What is are the next available node or nodes from Node
II What is are the next available node or nodes from Node
III. What is are the next available node or nodes from Node
B I. What is the output on using the following values: rewardPoints localCustomer false?
II What is the output on using the following values rewardPoints localCustomer true?
III. What is the output on using the following values rewardPoints localCustomer false?
C I. Path is defined from Node to Node Indicate whether Path is possible or impossible. If possible provide values for rewardPoints and localCustomer to reach your conclusion.
II Path is defined from Nodes Indicate whether Path is possible or impossible. If possible provide values for rewardPoints and localCustomer to reach your conclusion.
public static Status freeDelivery
long rewardPoints, boolean localCustomer
Status rv Status.INVALID;
long limit localCustomer : ;
long jumpLimit localCustomer : ;
if rewardPoints
if rewardPoints jumpLimit
rewardPoints limit;
if rewardPoints jumpLimit
rewardPoints limit;
rewardPoints jumpLimit;
if rewardPoints limit
rv Status.FREEDEL;
else
rv Status.CHARGEDEL;
return rv;
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
