Basic Shapes | |
Assigned: Fri Jul 11, 2003 | Due: Fri Jul 25, 2003 |
Grade: 75 points |
The "new" concepts covered in this program are:
|
Complete "Programming Challenge" 8 on
page 906 of our textbook, that I like to call
"BasicShapes"... plus a couple tiny additions:
The user interface to your program is very simple:
So, you're going to read in a file of BasicShapes. You can define your own file format and function(s), within the following guidelines:
Once you have a vector full of BasicShapes, then you should report the description and area of each. Implementation When using the vector for this assignment, create a vector of BasicShape pointers, not the actual objects. Since BasicShape is an abstract data class, it can't be used in a vector, and the compiler will go berzerk if you try (it's fun). So, this is probably what most people will want:
In the virtual function description, that I asked for, you can return a C-string, rather than a C++ string, if you like. BTW, strstream objects are a handy way to implement your description functions for each BasicShape derived class. There is, however, a bug in the Microsoft Visual C++ implementation of the strstream object. The C-string returned by the str member function of strstream is not correct. You need to terminate that C-string with a '\0' character after all your formatting is complete. Here's an example:
|
Your program will be graded on three areas: design, quality, and function. Please reference the "CSC 161 C++ Design and Coding Guidelines" posted on the site for the specific details on each of these three areas. 1. Program Design (20%, 15 points) It is essential to design your program before pounding it out in front of Visual C++. The design for this program requires:
You should include all the class interface files in your main() and be able to compile, but not build (or link) because your class member functions are not yet written. 2. Program quality (20%, 15 points) Please reference the 10-step quality checklist. 3. Program function (60%, 45 points) If your program doesn't compile or link, your grade for this section will automatically be cut in half and then I'll start from there. Please create at least 3 Shapes files to exercise your program. Good luck. |
Jul 11, 2003 I know that we have some people with "older" versions of the text book. Given this, I have copied to pages in the book describing the assignment and put them on top of the file cabinet outside my office door. I'll hand these out in class as well.
|