CMSC201
Programming Project One
out Wednesday 9/11/96
due midnight Wednesday 9/25/96
|
|
Introduction
Crop Circles are
unexplained designs that are imprinted over the span of usually one
night in fields of mostly wheat & corn, but have also occurred in
barley, oats, rape (canola), grass, trees, and even snow. In other
words, any organic material in which a distinguishable impression can
be made. They occur in crops during the spring & summer seasons
throughout various regions of the world, such as in the U.S., Canada,
throughout Europe, South America, Asia and Australia. Some people
believe that they are created by alien visitors and others are
convinced that they are all done by hoaxsters.
You have been hired by CCCS (the
Centre for Crop Circle Studies) to write computer programs
to help them explore and analyze the data they have been collecting on
crop circles. As your first task, you are to write a simple program
to look at various geometric data on the simplest of circles.
The task
Your program should read in data from the user for a crop circle and
print your analysis. For each crop circle, prompt the user for the
following data:
- an integer representing the "file number" for the siting
- a character string representing the name assigned to the siting
- an integer representing the radius of the circle in meters.
- an integer representing the circle's elevation above sea level in
meters
Your program should then print a table which shows the following
floating point data expressed in meters, inches and feet: the
circle's radius, circumference and area, and also the volume of a
sphere of that radius. In addition, print the ratios of the circle's
radius, area and volume to its elevation. An example of your program
in action might look like the following. We've shown the user's input
in italic font .
% ccat
Welcome to the CCCS Circle Analysis Tool
file number? 3152
description? Catonsville 9-9-96
radius in meters? RR
elevation in meters EEE
Catonsville 9-9-96 (#3152) radius=RR, elev=EEE
meters inches feet
---------------------------
radius RR.0 XYZ.ZY XY.ZZY
elevation LLL MMMMM NNNN
circumference XXX YYY ZZZ
area AAAA BBBB CCCC
volume DDDD EEEE FFFF
RATIOS:
radius/elevation GGG.GG
area/elevation HHH.H
volume/elevation III.I
The output of your program does not have to follow this example
exactly, but it should be reasonable close. We will leave it up to
you to remember the required formulae and chose appropriate estimates
for Pi and the conversion factors between the metric and English
measures. You can assume that data entered by the user are reasonable
(e.g., no negative radii). Consult the 201 Suggested
Coding Standards for recommendations on the form of your
program.
When and what to submit
The project should be submitted electronically by midnight, Wednesday,
September 25th. The details of how to do this will be provided next
week. In no case will we accept alien abduction as an excuse for late
submissions.
Some final advice
The truth is out there. Trust no one.