Circumference, area, radius of a circle

Trying to remove the declaration of RADIUS.
Need to add a variable declaration inside main() for a variable named radius.
Initialize radius to 5.0.

Does this mean to get rid of the const double RADIUS = 5.2;
and place inside main (radius)?


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// This program will output the circumference and area
// of the circle with a given radius.

// PLACE YOUR NAME HERE

#include <iostream>
using namespace std;

const double PI = 3.14;
const double RADIUS = 5.2;

int main()
{
	double circumference, area;

	// Calculate circumference
	circumference = 2 * PI * RADIUS;


	// Fill in the code to output the circumference

	cout << "The circumference of a circle of radius 5.2 ft is:  " << circumference << " ft " << endl;

	// Fill in the code to calculate area of circle

	area = PI * RADIUS * RADIUS;

	// Fill in the code to output  the area of the circle

	cout << "Its area is:  " << area << " sqft " << endl;


	cin.get(); // keep the console open till user presses ente


	return 0;
}
yes.

looks like

int main()
{
...
double radius = 5.0;
...

Topic archived. No new replies allowed.