Assignment #5 - 97B

Assignment #5 - 97B



Assignment 5
============

Mail to : HUQ2 on MUSICB
Due : 21th, March
Weight : 25

A team of ornithologists have recently returned from a field trip to
Papua-New Guinea. They have collected a large sample of raw data about 
one particular type of bird, which is the object of their studies. This
consists of two measures: the length of the beak, and the distance between
the eyes, for each bird.

The first measure, the length of the beak, can give a good estimate,
they believe, of the bird's age.  If the length is less or equal to 15mm,
then the bird is at most three months old. If the length is more than
15mm but less than or equal to 30mm, then it is a mature bird of either
sex. Finally, if the length exceeds 30mm, then it can only be an older 
male.

The second measure, the distance between the eyes, is needed in order to
establish a correlation with the brain size. It is classified as follows:

- 90mm to 100mm: category H
- 80mm to 89mm : " W
- 70mm to 79mm : " M
- 60mm to 69mm : " P
- 50mm to 59mm : " T
- 40mm to 49mm : " Z
- 30mm to 39mm : " X
- less than 30mm: " S

You have offered to help the ornithologists by determining efficiently, 
for statistical purposes, how many birds there are in either of the age 
groups, and how many birds there are in either of the brain size categories.

Your C program should read in a loop, different values from the keyboard. 
The input will have the two measures for one bird, per line. The negative 
number -1 terminates the sample.

Here is an example of a possible input :

20 55
35 98
16 43
-1

Here is an example of what your output should look like:

Number of birds in each of the age groups:

AGE GROUP NUMBER

baby 0
mature 2
older male 1

Number of birds in each of the brain size groups :

BRAIN SIZE GROUP NUMBER

H 1
W 0
M 0
P 0
T 1
Z 1
X 0
S 0

=========================================================================