Question: Consider the code of the method total _ cost _ with _ shipping which is used to calculate the total cost in a program with

Consider the code of the method total_cost_with_shipping which is used to calculate the total cost in a program with the following specification. The code is available on Moodle.
There is an online vendor that sells items to customers. The vendor sells two kinds of items and each kind has a different price. A customer can place an order containing any number of items from each kind. There should be at least one item per order. A 10AED shipping fee is waived for purchases of 200AED or more. The program asks the customer to enter the number of required items from each kind, then it should print the final cost of the order in a detailed fashion as presented in the output of a sample run below.
\table[[Kind,Item Price],[A,40],[B,70]]
Please enter the number of A items: 2
Please enter the number of B items: 1
Total Item Cost: 150 AED
Shipping Cost: 10 AED
Total Cost with shipping: 160AED
a. Draw a control flow graph for the program and clearly label each node to show its correspondence to a statement.
b. Calculate the program's cyclomatic complexity. What does this mean in terms of the number of test cases to cover the code with respect to its branches?
c. Develop a set of test cases to achieve full path coverage.
For each test case, you must provide the input values and the output value in addition to the covered path. The method has two integer parameters: num_A and num_B. The method returns the total cost with shipping.
 Consider the code of the method total_cost_with_shipping which is used to

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!