Boat Trip Assignment
Background
SCUBA diving on the Great Barrier Reef is a popular recreation for
many Queenslanders and tourists.
Commonly a dive boat will go out to the reef for several days at
a time, allowing divers several dives per day, without having to
return to land.
Such live-aboard boats visit several dive sites while out on the
reef.
Multiple days of multiple diving requires keeping a record of the
dives done, to ensure divers to not expose themselves to
decompression sickness.
In addition, when the boat is to be moved from one site to another, it
is important to be sure that everyone is on-board, for otherwise divers
left in the water have to swim back.
Most really good dive
operators are extremely careful, and have never left anyone behind.
Unfortunately their are
occasional slip-ups.
The Task
Complete a simple dive logging system, for use on SCUBA boats.
The system records the names of passengers, their status (on board
or in the water), and information about each dive they do (bottom
time and maximum depth).
Allow for up to 20 divers on a boat, and each diver doing up to 20 dives.
The program must accept the boat name as a command line option, and then
repeatedly present the user with options to:
- Add a passenger
- Record that someone has gone diving
- Log the dive information when someone returns from diving
- Report the boat status
- Exit
A sample run looks like this.
You can run the program ~cpgcs/CP1300/BoatTripAssignment/BoatTrip on
barra, to test any details that are not shown in the sample run.
To get you started, here's
BoatTrip.cpp that contains the
main function, and the included file
cstring.h.
You must design and implement the Boat, Passenger, and
Dive classes, and
create a Makefile to generate the executable.
Rules and Hints
- You may assume that correctly formatted commands will be entered.
Submission
The assignment is due in your tutorial of week 12 (the week starting 23/10/99).
Your program will be tested in the tutorial using the sequence of commands
given in the sample run above, and some other sequences.
You must also submit a printout of your source code files and
Makefile.
The assignment will be marked out of 15, according to the following
distribution:
- Execution - 9 marks
- Quality of code - 4 marks
- Makefile - 2 marks
Solution