****** When solving please clarify seperation of the code between the two programs! Thank you!!!! Two files are needed for this question.***** Please include pseudocode explain what the code is doing. Thank you for the help!! program5_3.py Write a program about triangles. You need two files, a module file and an executable file with a main method. The module file (defines two functions): One function that takes the three sides of a triangle as arguments. It returns True if the sides define a right triangle and False if it doesn't. HINT: This is easiest with a Math module function. The other function must use Heron's Formula to calculate and return the area of a triangle. Learn about Heron's formula online. The main file: Prompt the user to enter the three sides (longest first) of the triangle. Use integers only. Make sure that no side is longer than the sum of the other two sides. Call the function that returns a boolean and use it to output whether the triangle is a right triangle, or not. Call the function that returns the area. Display the value returned with two decimal places.   Two Example outputs Enter longest side of the triangle 14 Enter any another side of the triangle 11 Enter third side of the triangle 10 Not a right triangle Area is 54.64 >>>  Enter longest side of the triangle 10 Enter any another side of the triangle 8 Enter third side of the triangle 6 Triangle is a right triangle Area is 24.00

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

 

****** When solving please clarify seperation of the code between the two programs! Thank you!!!! Two files are needed for this question.*****

Please include pseudocode explain what the code is doing. Thank you for the help!!

program5_3.py
Write a program about triangles. You need two files, a module file and an executable file with a main method.
The module file (defines two functions):

  • One function that takes the three sides of a triangle as arguments. It returns True if the sides define a right triangle and False if it doesn't. HINT: This is easiest with a Math module function.
  • The other function must use Heron's Formula to calculate and return the area of a triangle. Learn about Heron's formula online.
The main file:
Prompt the user to enter the three sides (longest first) of the triangle. Use integers only. Make sure that no side is longer than the sum of the other two sides. Call the function that returns a boolean and use it to output whether the triangle is a right triangle, or not. Call the function that returns the area. Display the value returned with two decimal places.
 
Two Example outputs
Enter longest side of the triangle 14
Enter any another side of the triangle 11
Enter third side of the triangle 10
Not a right triangle
Area is 54.64
>>> 
Enter longest side of the triangle 10
Enter any another side of the triangle 8
Enter third side of the triangle 6
Triangle is a right triangle
Area is 24.00

 

Expert Solution
Expalantion

Here I have first of all created a file named triangle.py, and in this file, I have written the function to check for the right-angle triangle and to find the area of the triangle.

Then I have created another file named program.py and here I have asked the user for the three sides of the triangle.

Next, I have checked if the triangle is valid or not, and if it's valid then I have called the function to check whether the triangle is a right-angled triangle or not,

At last, I have printed the area of the triangle by calling the function that finds the area using heron's formula.

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Function Arguments
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
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education