Circles
Write a program that reads in the radius of a circle and prints the diameter,
area and circumference of that circle.
Also use the radius to calculate and print the volume (4/3 * pi *
r3) and surface area (4 * pi * r2)
of a red sphere with the same radius.
Use 3.14159 as the value of pi. You should use floating point variables.
Be sure to have a program header comment that contains the
following
You must adhere to the coding standards and indentation styles discussed in class.
Use comments within your code.
See course syllabus for project grading
Your project is due before class on
Wednesday October 28, 1998 for section 103
Tuesday October 27, 1998 for section 301
umbc8[21]% a.out Enter radius: 7 A circle with radius 7.000000 has: Circumference = 43.982260 Area = 153.937910 Diameter = 14.000000 A sphere with radius 7.000000 has: Volume = 1436.753827 Surface Area = 615.751640
When you have completed writing, compiling and testing your
project and are ready to submit you project enter the following
UNIX commands
(assuming your UNIX prompt is $ and your filename is circle.c)
$ script $ cat circle.c $ cc circle.c now execute your program at least 3 times by entering the command $ a.out and entering the values 5, 10.5, and 12.125 for the radius. then run the following commands to create the file to submit $ exit $ mv typescript circle.scr then submit your project by using the submit command $ submit cs104-103 proj1 circle.scr for section 103 OR $ submit cs104-301 proj1 circle.scr for section 301