Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ language Consider the following specification for a program. The triangle program accepts three integers, a, b, and c, as input. These are taken to

C++ language

Consider the following specification for a program.

The triangle program accepts three integers, a, b, and c, as input. These are taken to be sides of a triangle. The output of the program is the type of triangle determined by the thee sides: Equilateral, Isosceles, Scalene, or NotATriangle.

The input integers must satisfy the following conditions:

c1. 1 a 200 c4. a < b + c

c2. 1 b 200 c5. b < a + c

c3. 1 c 200 c6. c < a + b

The output of the program is the type of triangle determined by the three sides: Equilateral, Isosceles, Scalene, or not a triangle. If an input value fails any of conditions c1, c2, or c3, the program notes this with an output message, for example, Value of b is not in the range of permitted values. If values of a, b, and c satisfy conditions c4, c5, and c6, one of four mutually exclusive outputs is given:

  1. If all three sides are equal, the program output is Equilateral.
  2. If exactly one pair of sides is equal, the program output is Isosceles.
  3. If no pair of sides is equal, the program output is Scalene.
  4. If any of conditions c4, c5, and c6 is not met, the program output is Not A Triangle.

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

Essential Finance And Accounting For Managers

Authors: Leslie Chadwick

1st Edition

0273646486, 978-0273646488

Students also viewed these Databases questions