Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Fortran program to calculate the area of a triangle with 3 sides. To do this, your program should consist of following major steps:

Write a Fortran program to calculate the area of a triangle with 3 sides. To do this, your program should consist
of following major steps:
1- ask the user to the sides of a triangle via keyboard entry,
2- Check whether the entered sides can make a triangle. If the entered sides cannot make a triangle, an error
message should be printed on the screen. To form a triangle, each side must be shorter than the sum of the other
two sides.
3- calculates the area of the triangle based on this formulation,
4- prints the area of the triangle on the screen.
Sample Run 1:
This program calculates the area of a triangle with 3 sides.
Enter the length of the first side in meters.
8.8
Enter the length of the second side in meters.
3.7
Enter the length of the third side in meters.
4.0
The entered sides cannot make a triangle.
Sample Run 2:
This program calculates the area of a triangle with 3 sides.
Enter the length of the first side in meters.
3
Enter the length of the second side in meters.
7
Enter the length of the third side in meters.
6
The area of the entered triangle is 8.94427204 squared meters.
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

Recommended Textbook for

Practical Azure SQL Database For Modern Developers Building Applications In The Microsoft Cloud

Authors: Davide Mauri, Silvano Coriani, Anna Hoffma, Sanjay Mishra, Jovan Popovic

1st Edition

1484263693, 978-1484263693

More Books

Students also viewed these Databases questions

Question

5. Discuss the role of the Web in career management.

Answered: 1 week ago

Question

4. Design a career management system.

Answered: 1 week ago

Question

4. Evaluation is ongoing and used to improve the system.

Answered: 1 week ago