Home /
Expert Answers /
Computer Science /
i-question-04-8-points-create-a-module-library-named-mytriangle-that-contains-the-following-two-pa698
(Solved): I
Question 04 (8 points) Create a module (library) named MyTriangle that contains the following two ...
I
Question 04 (8 points) Create a module (library) named MyTriangle that contains the following two functions: \# Returns true if the sum of any two sides is greater than the third side. def isValid(side1, side2, side3): \# Returns the area of the triangle. def area(side1, side2, side3): Create another program with a main function; the main function reads three sides for a triangle and computes the area if the input is valid. Otherwise, it displays that the input is invalid. The formula for computing the area of a triangle is: s=( side 1+ side 2+ side 3)/2 area =s(s?side1)(s? side 2)(s? side 3)?? Note: submit two files, one file for the module and another with a program that has the main function. You must import MyTriangle module into your program to use both functions.
Here are some sample runs: Enter the first side: 1 Enter the second side: 3 Enter the third side: 1 Input is invalid Enter the first side: 1 Enter the second side: 1 Enter the third side: 1 The area of the triangle is 0.4330127018922193