Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The following fragment of code in Figure 1 show the function to calculating the total price of soft drink orders. The soft drink is sold

image text in transcribed

The following fragment of code in Figure 1 show the function to calculating the total price of soft drink orders. The soft drink is sold in boxes of 12 bottles and there are available in three flavour: falvour A (RM60), B(RM80) and C(RM100). int calcPrice (int qttyA, int qttyB, int qttyC, double price){ int discount = 0; if (attyA == 2) discount = 5; else if (qttyA == 1 && qttyB == 1) discount = 8; else if (qttyC == 3) discount = 10; else discount = 2; endir price = ((qttyA * 60) + (attyB * 80) + (attyc * 100)) * (100 - discount) / 100; * return price; } i. Draw the control flow graph of the code. ii. List down the possible test paths in order to achieve 100% test coverage for statement coverage. (test path should be written using this format: Sn+Cn..) ii. List down the possible test paths in order to achieve 100% test coverage for decision coverage. (test path should be written using this format: Sn+Cn..)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Filing And Computer Database Projects

Authors: Jeffrey Stewart

2nd Edition

007822781X, 9780078227813

More Books

Students also viewed these Databases questions

Question

Develop a marketing campaign for a training course or program.

Answered: 1 week ago

Question

Provide examples of KPIs in Human Capital Management.

Answered: 1 week ago

Question

What are OLAP Cubes?

Answered: 1 week ago