Question: U 1 _ Final: Write a program that tells the user if three lengths, entered by the user, of a triangle form an equilateral (

U1_Final: Write a program that tells the user if three lengths, entered by the user, of a triangle form an
equilateral (all 3 sides are equal), isosceles (2 sides are equal), scalene (all sides are different) or cannot
form a triangle. If the lengths make a triangle, calculate the perimeter and area of the triangle. Assume
the user will type positive decimal numbers. Also, ask the user if they want to run the program again to
be able to enter another set of numbers. When asking the user, the program should recognize input of Y,
y, N, and n. Any other answer would tell the user that they entered an invalid response (see sample
output).
Here are the formulas needed, where are the sides of the triangle:
P=a+b+c
S=a+b+c2
A=S(S-a)(S-b)(S-c)2
Note: Technically an equilateral triangle is also an isosceles triangle.
Sample Output (yours should look and function in a same manner):
welcome to the triangle der-terminator'!
Enter three side lengths of a triangle: 123
1.,2., and 3. cannot form a triangle.
Do you want to enter another set (yn)? y
Fnter three side lengths of a triangle: >34
2.6,3.6, and 4.0 forms a scalene triangle.
Perimeter =9.6
Area =2.9047375096555625
Do you want to enter another set (yn)? maybe
maybe is an invalid input
Do you want to enter another set (yn)? Y
Enter three side lengths of a triangle: 3,34
3.6,3.6, and 4.6 forms an isosceles triangle.
Perimeter =10.0
Area =4.47213595499958
Do you want to enter arother set (yn)?n
thank you for using this program.
 U1_Final: Write a program that tells the user if three lengths,

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!