
School of Engineering and Applied Science
Department of Computer Science
CSci 53 -- Introduction to Software Development
http://www.seas.gwu.edu/~csci53/spring04
Alice Armstrong
Project 3
due Thursday 2/12/04
Specification:
Getting a ship through the Panama Canal is a complex problem. The route is
heavily traveled and the locks are much narrowwer than many cargo and passenger
ships now made. Write an application that could help the dock manager answer
frequently asked questions about scheduling a trip through the canal.
Your program should interactively ask questions of the user until it is able
to determine
- the
estimated time to complete the passage (from arriving at the port on the
Atlantic side and exiting the last lock on the Pacific side)
- the
total cost (transit visa fees, inspection fees, quarintine fees, etc.)
- any
time restrictions on travel
- any additional paper work required
Below is the list of constraints in no particular order. Note that you
should focus on deciding which question to ask first so that you minimize the
number of questions you need to ask the user. Think carefully about
organization. Try reordering these constraints on paper before you write any
code.
- the base travel time through the canal is 4 hours
- the base cost, which covers all standard immigration costs, is $1000
- the base costs are calculated for commercial tourist or small craft passage
only -- cargo ships will require extra time for inspections and should
expect extra fees and tariffs
- ships wider than 50 yards at the widest point will NOT fit through the canal
- cargo ships carrying fresh produce will need to pass an agricultural inspection,
this inspection costs $400 in additional fees and requires 30 minutes to
complete
- cargo ships carrying dry goods may pass at the same time as ships carrying
livestock or raw materials
- small craft (ships narrower than 5 yards across) may only pass Sat and Sun 10am - 7pm
- small craft are not large enough to carry enough commercial cargo to require
further inspections
- cargo ships carrying livestock will need to provide certificates of quarantine
and pass an agricultural inspection costing an additional $500 and
requiring 2 hours to complete
- the livestock agricultural inspection is different from the produce inspection. Only one is required.
- ships carrying produce or livestock may only pass Mon - Fri, 6am-3pm
- ships carrying dry goods (grains, spices, etc.) must pass an agricultural
inspection which costs an additional $250 and takes 10 minutes
- tourists ships may not carry commercial cargo
- cargo ships may not carry tourists
- cargo ships may only cargo one category of
cargo (i.e. you are not allowed to carry raw materials and livestock on
the same same ship)
- ships carrying raw materials (steel, cotton, granite, etc) may only pass from
8pm-3am, Mon-Fri
- ships carrying raw material require a 20 minute international trade inspection which costs $100 and
must pay a tariff of $500
- commercial tourist ships may only pass Mon-Fri 3:30-7:30 and Sat, Sun 10am - 7pm
Here are a few sample runs of the program:
>How wide is your ship (in yards) at its widest point?
57
>I'm sorry, the canal cannot accommodate your vessel.
>How wide is your ship (in yards) at its widest point?
43
>Is the purpose of your passage strictly tourism?(y or n)
y
>Schedule: M-F 3:30pm-8pm and Sat, Sun 10am-7pm
>Travel time: 4 hours
>Cost: $1000
>Inspections: Standard immigration
>How wide is your ship (in yards) at its widest point?
4.2
>Schedule: Sat, Sun 10am-7pm
>Travel time: 4 hours
>Cost: $1000
>Inspections: Standard immigration
>How wide is your ship (in yards) at its widest point?
46.1
>Is the purpose of your passage strictly tourism? (y or n)
n
>How would you describe your cargo: produce (P), livestock (L), >dry
goods (D), or raw materials (M)?
M
>Schedule: M-F 8pm-3am
>Travel time: 4 hours, 20 minutes
>Cost: $1600
Notes about Testing
You should show a test case for each possible scenario. Your output need not
look exactly like this example. You are free to design the questions you ask
and the way you present the information to the user, but you must be clear.
(end of assignment)