Home CPSC 220

Circle Calculation

Objective

To get more practice with using functions.

Task

Your task is to write a program that will read in the radius of a circle, and print out the diameter, circumference and area.

Your program should use a separate function for doing each calculation, and should use parameters and return values to pass information back and forth.

The formulas are given below:

$diameter = 2 \times radius$

$area = \pi \times radius^2$

$circumference = 2 \times \pi \times radius$


Details


Submitting

When your program works, email the code to ifinlay@umw.edu.

Copyright © 2018 Ian Finlayson | Licensed under a Creative Commons Attribution 4.0 International License.