| Assigned | Mon Oct 25th, 2004 |
| Design Due | Sunday Oct 31 at 11:59pm |
| Program Due | Sunday Nov 7th at 11:59pm |
| Updates | 28 October 2004
The requirement that the Truck use operator+= to add a DeliveryRcd is superfluous and has been removed. There's no need for any such Truck operation. |
It's possible we missed some, but we're confident you'll point them out to us :-)
The handling of the BOXES and TOYS command in project 3 is the same as the required implementation in project 2. Those who did the extra credit version of project 2 are required to modify their code to revert to the required method which is repeated for you here.
In this project you will be filling boxes (plural) with round tinker toys and shipping them to the assembly plant in a truck. 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.
As in project 1 and 2, commands will be read and processed from a command file. The file will contain new commands and modified commands that you processed in project 2. As in project 2, 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 2. 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 2.
The operations of each class are described below. Each operation 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
The valid colors for a RoundToy are found in the command file.
The number and names of valid colors may be different
for each command file, but the color names are guaranteed NOT to contain spaces.
A service that prints the box summary to the specified stream.
This service must be provided by overloading the output operator for the Box.
The output operator may not be a friend function. (Hint: existing functions may be reused)
The summary lists the number of round toys in the box and their color (recall that all toys in the box will be the same color).
A service that stores the specified round tinker toy in the box. This service must be provided
by overloading the += operator for the Box.
A service that prints the Truck's current load and delivery log.
This service must be provided by overloading the output operator for the truck
The output operator may not be a friend function.
This output contains the following
information. See the sample output below.

As an academic exercise, all data members of this class must be dynamically allocated. This will not be a requirement for project 4. The DeliveryRecord supports the following operations
DeliveryLog
A DeliveryLog is a set of DeliveryRecords kept in the order in which deliveries are made.
Each Truck keeps a DeliveryLog so it can report its delivery activity details.
The DeliveryLog supports the following operations


The first line of the command file contains an integer (let's call it N), which tells how many
colors of RoundToys we'll be manufacturing.
The next N lines contain the names of the colors (one per line without spaces).

You must provide the makefile for this project. Use the makefile from project 2 and modify it appropriately. If you don't change the names of the files from project 2, the changes will be minimal.
The graders will be typing the command make Proj3 when they grade your project. This command must cause all .cpp files to be compiled and the executable named Proj3 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, Proj3, 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.