CIS 1033 - Fundamentals of Programming

Bob Comer, Professor, CIS/CSC


Programming Assignment 1 - Circle Calculations

Due Monday, June 7

Write a C++ program that calculates and prints the circumference and area of a circle given its radius. Make the circle constant pi a named constant. Since we have not covered input from the keyboard, set the value of the circle radius in your program (use a radius of 25).

Constants
 

pi

3.1416

 

Variables
 

radius

circle radius (set to 25)

circumference

is 2 times pi times the radius

area

is pi times the radius squared

 

Output
Your output should look like the example below. The fractional numbers you get may not agree exactly with those shown.
 

Circle Measurements
Radius:                       25
Circumference:           157.08
Area:                          1963.499878

 


Return to Fundamentals Home Page

Copyright: Ó1999 by the Austin Community College

Department of Computer Studies. All rights reserved.

Comments to: Bob Comer

Last updated: June 1, 1999