Q2) A triangle can be classified based on the lengths of its sides as equilateral, isosceles, or scalene. All three sides of an equilateral triangle have the same length. An isosceles triangle has two sides that are the same length, and a third side that is a different length. If all the sides have different lengths, then the triangle is scalene. Write a program that reads the lengths of the three sides of a triangle from the user. Then display a message that states the triangle's type. Assume integers as side lengths, 0> side-length < 100. Make sure to prompt errors for length < 0 or > 100. You don't need to use loops if you use them use exit condition such a yes/no with an appropriate prompt.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 21PE
icon
Related questions
Question

using python, show #comments

Q2) A triangle can be classified based on the lengths of its sides as equilateral, isosceles, or
scalene. All three sides of an equilateral triangle have the same length. An isosceles triangle has
two sides that are the same length, and a third side that is a different length. If all the sides have
different lengths, then the triangle is scalene.
Write a program that reads the lengths of the three sides of a triangle from the user. Then display
a message that states the triangle's type.
Assume integers as side lengths, 0 > side-length < 100. Make sure to prompt errors for length <
0 or > 100.
You don't need to use loops if you use them use exit condition such a yes/no with an appropriate
prompt.
Transcribed Image Text:Q2) A triangle can be classified based on the lengths of its sides as equilateral, isosceles, or scalene. All three sides of an equilateral triangle have the same length. An isosceles triangle has two sides that are the same length, and a third side that is a different length. If all the sides have different lengths, then the triangle is scalene. Write a program that reads the lengths of the three sides of a triangle from the user. Then display a message that states the triangle's type. Assume integers as side lengths, 0 > side-length < 100. Make sure to prompt errors for length < 0 or > 100. You don't need to use loops if you use them use exit condition such a yes/no with an appropriate prompt.
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning