CIS 22 - Data Structures
Spring 2005

Assignment #0.1 A Review of Separate Compilation - Unix

Due: January 31, 2005 or February 3, 2005
(one of 0.1 or 0.2 should be handed in on January 31; the other may be handed in on February 3.)

This program must be done under Unix

Description

Write a program that consists of 3 source files: sillyfuncs.h contains declarations for the following: sillyfuncs.c contains the definitions of the avgof3, medianof3 and doubleORnothing functions.
main.c repeatedly prompts the user for three numbers, calls the functions and prints out the appropriate output. Since you are using separate compilation, main.c will contain the line     #include "sillyfuncs.h"
The main program should NOT include sillyfuncs.c

Output and Testing

Be careful to devise adequate test cases. Do not simply the call the functions several times. Make sure to choose test data that reflects different possible scenarios (e.g., first input is less than the second; the first input is greater than the second; the two inputs are equal; input data is negative or zero).
I will be looking at the clarity of your output as well as your testing. You may annotate the output to indicate what the test cases demonstrate.

What to submit

Hand in one copy of the three source files and a separate copy of the output for each test you perform.