Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A) [4pt/ Draw the control flow graph (CFG) for the following code segment NMNMM 18 19 1 public double calculateTotalcost int amount, boolean nextday) 2

image text in transcribed
A) [4pt/ Draw the control flow graph (CFG) for the following code segment NMNMM 18 19 1 public double calculateTotalcost int amount, boolean nextday) 2 3. double fee = 0; 4 $ 11 (next day) 6 fee = 18; 8 1 9 10 double tax amount. 0.15; 11 12 if (amount >= 1000) 13 14 charge amount = 0.09 - fee; 15 1 15 else if (amount >- 500) 17 charge - amount. 0.07 + fee; 1 20 else if (amount > 200) 21 22 charge - 15 + fee; 23 24 else if (amount >- 100) 25 26 charge - 12 + fee: 27 1 28 else if (amount > 50) 29 1 30 charge - 10 fee: 31 1 32. else 33 34 charge - 6 fee: 35 1 35 37 total - amount + tax + charge: 39 return total; 40 41 Wend N NNNNNNNNN DOWNHOOL B) [1pt] Calculate the cyclomatic complexity of the CFG C) 13pt/ Based on the path testing technique; find the generated independent paths from this CFG

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

Database Programming With Visual Basic .NET

Authors: Carsten Thomsen

2nd Edition

1590590325, 978-1590590324

More Books

Students also viewed these Databases questions