Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write in fortran please,thanks 1. Create a Fortran MODULE that contains derived types to store information about four geometric figures: circle, square, rectangle, and triangle.

write in fortran please,thanks image text in transcribed
1. Create a Fortran MODULE that contains derived types to store information about four geometric figures: circle, square, rectangle, and triangle. For a circle the structure should store its radius and its centre; for a square, the length of a side; for a rectangle, the lengths of two adjacent sides; and for a triangle, the lengths of the three sides. Your module should include functions to compute the area of each type of shape. Write a program that reads one of the letters c (circle), S (square), R (rectangle), T (triangle), and the appropriate numeric quantity or quantities for a figure of that type, and then calculates its area. For example, the input R 7.2 3.5 represents a rectangle of length 7.2 and width 3.5; and T 3 4 6.1 represents a triangle having sides of lengths 3, 4, and 6.1. The area of a triangle can be found by using Hero's formula: where a, b, and c are the lengths of the sides, and s is one-half of the perimeter. If the user enters an invalid shape, your program should print out Invalid figure type and stop

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

Spomenik Monument Database

Authors: Donald Niebyl, FUEL, Damon Murray, Stephen Sorrell

1st Edition

0995745536, 978-0995745537

More Books

Students also viewed these Databases questions

Question

Why is the System Build Process an iterative process?

Answered: 1 week ago