Mr. Surd believes that he has declared (i.e., written prototypes for) all the functions needed for the program, and he has written code to fill in some of the corresponding function definitions. For the remaining functions, he simply copied their prototypes and inserted the comment // STILL TO BE IMPLEMENTED. You are to do the following.
For example, suppose the code included a function with the following prototype and comments:
// precondition: a and b are integers // postcondition: return value is a+b int addTwoInts(int a, int b);and the following definition:
// precondition: a and b are integers // postcondition: return value is a+b int addTwoInts(int a, int b) { // STILL TO BE IMPLEMENTED }
Then you would replace the comment in the function definition with the following line:
return a + b;
You should not need additional functions, but if you do, put their prototypes and any other needed declarations after the comment
// PLACE FOR ADDITIONAL DECLARATIONSand their definitions after the comment
// PLACE FOR ADDITIONAL CODE
Hint: Before beginning to write code, you should review other parts of Mr. Surd's code, especially the functions identified in the comments as ``Helper functions''. Mr. Surd's daughter Abby says she knows how to complete his program by adding only 45 additional lines of code. If you find yourself writing a lot more, you are probably doing something the hard way.
To help you:
An executable for a sample solution
is available in
/users/blm1320/ASCIIart/asciiArtSolution;
you can execute this program to see how your program should behave.
(You can execute it by logging into one of the lab machines and
typing its full name as given above. You can also copy it to your
own directory.)