Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The program must use If else if statements Write a FORTRAN program that allows the user to choose which of the following two types of

The program must use If else if statements image text in transcribed
image text in transcribed
Write a FORTRAN program that allows the user to choose which of the following two types of problems he wants the program to solve: (1) Finding the area of a circle if the radius of the circle is given (2) Finding the area of a rectangle if its length and width are given First the program should ask the user which calculation he wants the program to do. The program should prompt the user as follows Enter the type of the problem that you have: Enter c or C for finding the area of a circle Enter r or R for finding the area of a rectangle If the user enters the character "c" or "C", the program will ask the user for the radius of the circle. Then the program will compute and display the area of the circle. A sample output should be like the following: The radius of the circle is: 2.3 The area of the circle is: 16.6190 If the user enters the character "r" or "R", the program will ask the user for the length and the width of the rectangle. Then the program will find and display the area of the rectangle. A sample output should be like the following: The length of the rectangle is: The width of the rectangle is: The area of the rectangle is: 3.2 5.4 17.2800 If the user enters other letters (not any of those "c", "C", ""R"), your program will display the following message: Requirements: (1) After the program heading, you must indicate your name. (2) All variables must be declared as real variables and you must use meaningful names for all the variables (3) You must declare PI as a named constant with the real value 3.141593 (4) The program must display clear prompts for user input. (5) You must use an IF-ELSE IF construct in your program. (6) You must indent the body of each IF statement by two or more spaces to improve the readability of your code The formula for the area of a circle is A , where r is the radius, and the formula for the area of a rectangle is A -L*W, where L is the length and Wis the width

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

Students also viewed these Databases questions