Question: PYTHON Write a program that asks the user for the dimensions of 3 sides of a triangle. If the side dimensions indeed can make a
PYTHON Write a program that asks the user for the dimensions of 3 sides of a triangle. If the side dimensions indeed can make a valid triangle then the program should use these values to determine the perimeter and the area of the valid triangle. If not a valid triangle, inform the user and end the program.
The program should ask the user for width and length of a rectangle, calculate the area of the rectangle and compare it with the area of the valid triangle and inform the user which area is grater or if they are equal.
What makes a valid triangle?
The SUM of ANY TWO SIDES MUST ADD UP TO BE GREATER THAN THE LENGTH OF THE REMAINING THIRD SIDE.
OR (with sides A,B,C):
A + B > C, and
B + C> A, and
A + C>B
Area of a Triangle:
The formula is represented by
Area = ? (s(s-a)(s-b)(s-c)) .. where s=(a + b + c) / 2
Area of a Rectangle:
Area = length x width
Square roots can be calculated in python using the following code snippet.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
