Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE USE WHILE LOOPS, BREAK, IF , ELSE STATMENTS. U 1 _ Final: Write a program that tells the user if three lengths, entered by

PLEASE USE WHILE LOOPS, BREAK, IF, ELSE STATMENTS. 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: 1231.9,2., and 3.9 cannot form a triangle.
Do you want to enter another set (yn)? y
Fiter three side lengths of a triangle: >342.6,3.6, and 4.6 forms a scalene triangle.
Perimeter =9.6
Area =2.9047375096555625
Do you want to enter arother 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 l 34
3.9,3.6, and 4.6 forms an isosceles triangle.
Perimeter =10.
Area =4.47213595499958
Do you want to enter arother set (yn)? n
Thank you for using this program.
image text in transcribed

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

Students also viewed these Databases questions

Question

Differentiate 3sin(9x+2x)

Answered: 1 week ago

Question

Approaches to Managing Organizations

Answered: 1 week ago

Question

Communicating Organizational Culture

Answered: 1 week ago