Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Rewrite the program segment 14-20 such that the compound conditions are replaced by nested if-then-else statements. Compare the cyclomatic complexity of your program with that

Rewrite the program segment 14-20 such that the compound conditions are replaced by nested if-then-else statements. Compare the cyclomatic complexity of your program with that of the existing version.

14. If (a = b) AND (b = c)

15. Then Output ("Equilateral")

16. Else If (a != b) AND (a != c) AND (b != c)

17. Then Output ("Scalene")

18. Else Output ("Isosceles")

19. EndIf

20. EndIf

Also, look at the original program segments 14-20. What happens with a test case (e.g., a = 3, b = 4, c = 3) in which a = c? The condition in line 14 uses the transitivity of equality to eliminate the a = c condition. Is this a problem?

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

Modern Database Management

Authors: Fred R. McFadden, Jeffrey Slater, Mary B. Prescott

5th Edition

0805360549, 978-0805360547

More Books

Students also viewed these Databases questions

Question

In Exercises find the indefinite integral. - 3x (x + 3)3/2 dx

Answered: 1 week ago