Assigned | Monday Feb 23, 2004 |
Design Due | Sunday Feb 29th at 11:59pm |
Program Due | Sunday March 7th at 11:59pm |
Updates | Feb 29th - The order of data input when LOADing a cargo container
was different in the description and the sample output. The description is correct
and the sample output has been modified.
Feb 26th - when the plane crashes only the fuel is affected and should be reported as zero. The current city and values for the hours and mileage should be reported as if the fatal flight had not taken place. Feb 24th - the order of the first two command line arguments was incorrect. The volume is the first argument and the weight is the 2nd argument as now listed in the project description |
Your program will provide the user with a set of commands that control the plane. The user will be able to fly the plane, load cargo, unload cargo and print the current status of the plane. An acceptable format for the output is found in the sample output section below.
Project 2 will be executed from the command line with 5 parameters in the order listed below. All numeric arguments must be positive.
As in project 1, the function prototypes specify the parameter types and return types, but
not the method of passing the parameters or returning the values. These are left to you, but you must
use the "best" method for each data type and purpose as discussed in class.
Classes
To implement your project, you will design and implement the following
classes. The interfaces for the classes are shown below. No other public
methods are permitted. You may implement any private methods you deem necessary.
All data members of all classes must be private.
Be sure that your classes make correct use of const.
The Cargo Class
This class models a single cargo container. You should be able to adapt
the Cargo structure and related code (Cargo.cpp) from project 1 for this class.
Cargo containers are uniquely identified by their label. You may assume that no two
containers have the same label.
The CargoPlane class
The CargoPlane class models a single plane which contains zero or more
Cargo containers and many additional attributes. You should be able to adapt much
of the code from Proj1Aux.cpp for this class.
The CargoPlane class supports the following public methods.
Summary of Project Requirements, Restrictions and Assumptions
Reprompt immediately if the user inputs any negative value.
Sample Output
This sample output is provided to show you a reasonable
output format which satisfies the project requirements.
It is not necessary that you follow this format exactly,
but whatever format you choose must provide all required information,
including tabular form for the cargo.
Note that the use of tabs will make the columns fg
left-justified.
Free Advice and Information
Project Design Assignment
Your project design document for project 2 must be named p2design.txt.
Be sure to read the design specification carefully.
Submit your design in the usual way: submit cs202 Proj2 p2design.txt
The "make" utility is used to help control projects with large numbers of files. It consists of targets, rules, and dependencies. You will be learning about make files in discussion. For this project, examine and understand the makefile for project 1, then modify it for project 2.
When you want to compile and link your program, simply type the command make or make Proj2 at the Linux prompt. This will compile Proj2.cpp, CargoPlane.cpp and Cargo.cpp and create the executable named Proj2. Your executable MUST be named Proj2 as that name is used in the testing/grading scripts.
The make utility can also be used for compiling a single program without linking. For example, to compile Cargo.cpp, type make Cargo.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, Proj1, 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.