[CD] Write a program that reads in the radius of a circle and prints the circle’s diameter, cir- cumference and area. Use the constant value 3.14159 for ?. Do these calculations in output state- ments.

What will be an ideal response?


```
# Given the radius of a circle, output its diameter,
# circumference and area.

# obtain user-entered radius
radius = raw_input( "Enter the circle's radius: " )
radius = float( radius )

pi = 3.14159 # use 3.14159 for pi

# calculate and print the circle's diameter
print "Diameter is", ( 2 * radius )

# calculate and print the circle's circumference
print "Circumference is", ( 2 * pi * radius )

# calculate and print the circle's area
print "Area is", ( pi * radius ** 2 )
```
Enter the circle's radius: 8
Diameter is 16.0
Circumference is 50.26544
Area is 201.06176

Computer Science & Information Technology

You might also like to view...

When you have frozen rows and columns, what happens when you press the Ctrl+Home combination?

A) The first unfrozen cell becomes the active cell. B) Column A and whatever row was active when you pressed the combination becomes the active cell. C) Row 1 and whatever column was active when you pressed the combination becomes the active cell. D) A1 becomes the active cell.

Computer Science & Information Technology

Indexed folders are folders that have been sorted in alphabetical order

Indicate whether the statement is true or false

Computer Science & Information Technology

To remove the extra space between lines in the letter address, tap _________________ .

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

Each data variable that exists for every object is called a(n) ____ variable.

A. instance B. class C. program D. numeric

Computer Science & Information Technology