Assigned | Mon Sept 27, 2004 |
Design Due | Sunday Oct 3 at 11:59pm |
Program Due | Wed Oct 13 at 11:59pm |
Updates | 02 Oct
The sample output originally provided was NOT produced
from Proj2Cmds.dat found in Mr. Frey's public directory. The
sample output has been replaced with output the WAS
produced from Proj2Cmds.dat
30 Sept The description of the Truck class now contains a necessary service for loading Boxes 28 Sept The description of RoundToy constructor indicates that it uses the specified "height, length and width". Clearly these attributes should be diameter, color and number of holes. The project description has been modifed accordingly. |
In this project you will be filling boxes (plural) with round tinker toys and shipping them to the assembly plant in a truck. As in project 1, we will make round tinker toys with various diameters and colors. We will be filling multiple boxes with varying dimensions, placing them in the truck and driving the truck to the assembly plant. Our truck is especially made for UMBC -- it has unlimited capacity and never gets full.
There two significant functional differences between the projects with respect to manufacturing
and packing toys in a box.
As in project 1, commands will be read and processed from a command file. The file will contain new commands and modified commands that you processed in project 1. As in project 1, Your program will open the command file and loop until all commands found in the file have been executed. All valid commands in the file are properly formatted, but you may encounter invalid commands. See the Command File section below.
As you will see, many of the operations listed below appear to be quite similar to functions that were specified in project 1. This is not a coincidence. One of our goals is for you to see the value of writing reusable and/or easily modifiable code. This project gives you a chance to reuse and/or modify code from project 1.
The operations of each class are described below. Each operations is implemented as a single public member function of the class. It's up to you to provide complete prototypes (name, parameters (and how they are passed), return types and "constness") for each public member function. No other public member functions are allowed, but you may implement whatever private member functions you deem necessary. None of the operations listed below read the command file. All data members of all classes must be private
When a toy does not fit in the box, the box is sealed and placed on the Truck for delivery. The toy is then placed in the next available box. If there are no more available boxes, the Truck is sent to the assembly plant to deliver the boxes that have been filled. (Yes, it's conceivable that we'll be shipping empty boxes.) Once the truck arrives at the assembly plant the boxes are unloaded and the truck immediately returns. When more boxes are delivered (BOXES command), packing toys in the boxes will automatically begin again.
Similarly, when all requested toys have been produced, the box being packed is sealed and placed on the Truck. The Truck is sent to the assembly plant to deliver the boxes that have been filled. Once the truck arrives at the assembly plant the boxes are unloaded and the truck immediately returns. Once an order is given to make more toys (TOYS command), packing toys in boxes will automatically begin again.
Summary -- if you ever run out of boxes or toys, seal the current box being packed and deliver the boxes to the assembly plant. Once more boxes or toys are available, continue packing. Your program should ignore the DELIVER command from the file (do not print an error).
When your program ends, display the number of unused boxes and unpacked toys (one or both of these should be zero), along with the box or toy details.
Be sure to submit a text file named ExtraCredit.txt telling the grader that you have implemented the extra credit version of the project. Extra Credit projects will have different "correctness" criteria than regular projects.
You must provide the makefile for this project. Use the makefile provided to you for project 1 and modify it appropriately. If you don't change the names of the files from project 1, the changes will be minimal.
The graders will be typing the command make Proj2 when they grade your project. This command must cause all .cpp files to be compiled and the executable named Proj2 to be created.
The make utility can also be used for compiling a single program without linking. For example, to compile Box.cpp, type make Box.o.
In addition to compiling and linking your files, make can be used for maintaining your directory. Typing make clean will remove any extraneous files in your directory, such as .o files and core files. Typing make cleanest will remove all .o files, core, Proj2, and backup files created by the editor. More information about these commands can be found at the bottom of the makefile.
The grade for this project will be broken down as follows. A more detailed breakdown will be provided in the grade form you receive with your project grade.
You can check to see what files you have submitted by typing
More complete documentation for submit and related commands can be found here.
Remember -- if you make any change to your program, no matter how insignificant it may seem, you should recompile and retest your program before submitting it. Even the smallest typo can cause compiler errors and a reduction in your grade.
Avoid unpleasant surprises!
Be sure to use the submitmake and submitrun utilities provided for you to compile, link and run your program after you've submitted it.