CSE2305 - Object-Oriented Software
Engineering
Assessment
Assignment 3
This assignment is due by 11.59pm Friday, 22 September (
)... just after International Talk Like a Pirate Day
Total marks: 50.
Contribution to final mark: 5%.
Synopsis
[50 marks]
Ahoy mateys... Pirate Pete runs a shop that leases ships to pirates intent on causing mayhem and destruction. He has a ship for all occassions. Recently he has found it hard to keep track of which ships have been loaned and which are moored at his wharf. The problem is exacerbated by the dangers of the trade... his ships are often sunk whilst they are out on loan! Pete has decided to computerise his inventory, keeping track of which ships are "in" and which are "out", and also when the ships that are "out" are to be returned.
Pete has three types of ship:
|
|
Spanish galleons; |
Schooners; |
... and Canoes (for the pirate down on his luck).
|
Spanish galleons, schooners and canoes may come mounted with guns. You can only fit a single gun to a canoe. |
|
Every boat comes free with a talking parrot that incessantly reminds the skipper to return the ship in one piece. The ship can't leave the harbour unless it has a parrot on board. Sometimes parrots fly off and leave a ship during its voyage never to be seen or heard again. |
For any item let by the Ship Shop we are interested in the following information:
- The type of item (galleon, schooner, canoe, sail, cannon, parrot)
- The number of items of this type currently stored at the wharf
- The number of items of this type currently out at sea
- The wholesale price (The cost for Pete to buy a new item of this type)
- Rental fraction (The percentage of the wholesale price it costs to rent the item per week)
- The rental price per week (This is equal to the wholesale price multiplied by the rental fraction (apart from parrots which are free). For example, if the wholesale cost is 2000 gold coins and the rental fraction 50%, the
rental price is 1000 gold coins per week.)
- Deposit fraction (Before a ship is rented out to a pirate, a deposit must be paid up front. For example, this deposit might be 200% of the cost of the ship. That way if the ship gets lost at sea Pirate Pete isn't out of pocket. The deposit is returned after the ship is returned to Pete. Pete doesn't even care who borrows his ships. Actually, sometimes he prefers it if they are never seen again since he can then pocket the deposit!)
The system is
to have the following features:
The ability to add and delete items from the database of stocked items as Pete buys more goods or goods are lost at sea.
- The ability to increase the number of copies of an existing item (this
is done when new stock arrives).
- The ability to read and save the database to Pirate Pete's computer hard disk.
- The ability to rent an item (hence decreasing the number of that item
held at the wharf). It should not be possible to rent an item that is currently out at sea. Pete only rents out ships that he has at his wharf as many ships never return!
- The ability to list an inventory of all items at the wharf or all items currently owned (even if they are out at sea).
- The ability to display all items that are out of stock.
- The ability to see if an item of a particular type is at the wharf and available for rent.
- Searches that match should display all the information about that
item type, including the number available and their deposit cost and cost to rent.
Any interaction with the system should be via a simple text interface. The
system should automatically load the database on startup, and save it before
quitting. You should be able to specify the name of the database file as a
command line argument.
Develop an object-oriented design for this system using
UML diagrams.
Also, you will need to devise a test plan for your design. The test plan should
test all the features of the system as specified.
You should submit the following:
- A design of the various classes required
by the system, including appropriate class, object and
interaction (sequence) diagrams (in pdf format).
- Written description of key classes and their functions.
- A plan for testing
the completed system.
- Written components of the assignment should be done in plain text (i.e.
readable using a standard text editor such as
vi
).
See the submit page for details on how to submit
your assignment.
This material is part of the CSE2305 - Object-Oriented
Software Engineering course.
Copyright © Alan Dorin, 2006. All rights reserved except for the images which are from Apple's Electronic Dictionary.
Last Modified:
September 18, 2006