This is Force 2.0 with Fortran 77:
! Program to find the area and perimeter of a circle
program circle
implicit none
! Variable declaration
real :: area, perimeter, radius
real parameter :: pi = 3.142
! Calculating the area
write(*,*) 'Enter the radius of a circle'
read(*,*)radius
area = pi * radius **2
write(*,*) 'The area of the circle is:', area
!Calculating the perimeter
perimeter = 2*pi*radius
write(*,*) 'The perimeter of the circle is:', perimeter
PAUSE
end program circle
This program must be done with and without functions. Also, I'd like the errors to be fixed
Without Function:
Code:
! Program to find the area and perimeter of a circle
program circle
implicit none
! Variable declaration
real :: area, perimeter, radius, pi
pi = 3.142
! Calculating the area
write(*,*) 'Enter the radius of a circle'
read(*,*)radius
area = pi * radius **2
write(*,*) 'The area of the circle is:', area
!Calculating the perimeter
perimeter = 2*pi*radius
write(*,*) 'The perimeter of the circle is:', perimeter
PAUSE
end program circle
Image of the Code:

Image of Input and Output:

Explanation: Declared pi as a real variable and initialized its value. Error was that pi was not declared as real variable.
With Function:
Code:
program circle
real :: area, radius, perimeter
write(*,*) 'Enter the radius of a circle'
read(*,*)radius
area = area_circle(radius)
perimeter = perimeter_circle(radius)
Print *, "The area of a circle is:"
Print *, area
Print *, "The perimeter of a circle is:"
Print *, perimeter
end program circle
function area_circle (r)
implicit none
real :: area_circle
! local variables
real :: r
real :: pi
pi = 3.142
area_circle = pi * r**2
end function area_circle
function perimeter_circle (r)
implicit none
real :: perimeter_circle
! local variables
real :: r
real :: pi
pi = 3.142
perimeter_circle = pi * r * 2
end function perimeter_circle
Image of the Code:


Image of the Input and Output:

Explanation: We have created 2 functions area_circle and area_perimeter and called the functions to get the answer.
If the answer helped please upvote. It means a lot. For any query comment below.
This is Force 2.0 with Fortran 77: ! Program to find the area and perimeter of...
1. Write a program that determines the area and perimeter of a square. Your program should accept the appropriate measurement of the square as input from the user and display the result to the screen. Area of Square = L (squared) Perimeter of Square = 4 * L 2. Write a program that determines the area and circumference of a circle. Your program should accept the appropriate measurement of the circle as input from the user and display the result to...
Write a C program named assignment04.cpp that will ask for and read in a float for a radius ask for and read in a float for the height each of the following functions will calculate some property of a shape (area, volume, circumference, etc) The functions will accept one or two parameters (radius and/or height) and return the proper calculation. There is no input/output (cin or cout) in the function – just the calculation write the following functions float areaCircle(float...
in C++ use Inheritance for the following Shape Circle Sphere Cylinder Rectangle Square Cube You must define one class for each shape. And, use public inheritance when deriving from base classes. Circle int r; void area(); void perimeter(); void volume(); //No volume for circle Sphere int r; void area();//Sphere surface area= 4 × pi × radius2 void perimeter(); //No perimeter for Sphere void volume();//Sphere volume= 4/3 × pi × radius2 Cylinder int r, height; void area();// Cylinder surface area=perimeter of...
I wrote a program which computes the area and perimeter of a square, circle, or rectangle. As you will see in my main function, there is a for loop in which the user is supposed to be able repeat the program until they enter "q" to quit. However, my program runs through one time, the prompt appears again, but then it terminates before the user is allowed to respond to the prompt again. I'm not able to debug why this...
C++ programming question will upvote
A) One of the problems that have been discussed in the class is to write a simple C++ program to determine the area and circumference of a circle of a given radius. In this lab you will be rewriting the program again but this time you will be writing some functions to take care of the user input and math. Specifically, your main function should look like the following int main //the radius of the...
Write a program using the class to find out the area of a circle and volume of a cylinder. [* area of a circle=πr2, the volume of a cylinder=πr2*h where h is the height of the cylinder and r is the radius of the circular end of the cylinder] 1. The member variable should be private 2. Use public member functions to execute your program. 3. Use set ( ) function to access the private members 4. Use another approach...
C++ Pr ogramming (CSC-115) Functions (pass by Reference) Programming project Using FUNCTIONS, write a C++ program that calculates the Area of a cirele, a square and a rectangle. Your program must prompt the user to select which area is to be calculated. Document your program. Apply the do while loop to repeat the program Apply the while loop for input validation. Apply the switch statements or the if/ else if statement to prompt the user for the area's selection. Based...
Using separate files, write the definition for a class called Point and a class called Circle. The class point has the data members x (double) and y (double) for the x and y coordinates. The class has the following member functions: a) void set_x(double) to set the x data member b) void set_y(double) to set the y data member c) double get_x() to return the the x data member d) double get_y() to return the the y data member e)...
Write a program to print five tables (5) displaying the range that a ball would travel when it is thrown with an initial velocity v0 and angle θ. One table should be calculated for each of the initial velocities: 0, 1, 10, 100, and 1000 meters per second. The table should have one row for e very 5 degrees for angles between 5 and 85 degrees inclusive. Note that this assignment does not require a READ statement since all data...
Please use C++ and output have to look like that
Create a menu driven C++ program with functions. There must be four functions, calculating the size of area of circle, rectangle, triangle, and parallelogram. You are required to create those four functions and invoke them from the main program in order to reccive any credit. Please Submit: . A flowchart of your program with equations and expected results. 4 points) 2. Printout of your C++program with a heading comment, also...