Project #5 (Cruise System)

CMSC 132

Due Dates (Two Deadlines)

Design: Wed Oct 25, 6:00 pm (No late deadline)

Implementation: Mon Oct 30, 6:00 pm

Object-Oriented Programming II

Type of Project: Closed

Fall 2006


Objective

This project has several objectives:

This assignment is considered a closed project;  make sure you read the open/closed policy before continuing working on this project. 

Overview

For this project you will develop and implement a design for a cruise line database.  The database keeps track of passengers, room attendants, ship information, etc. (more details are provided below).  The first part of your project consists of submitting an UML class diagram representing the design of the cruise line database system.  The second part consists of implementing your design.  keep in mind that each part has a separate deadline.

Your project will graded as follows:

Grading:

Keep in mind that your implementation must match your design, otherwise you will lose significant points.  We encourage you to start working on this project as soon as possible, as there are a lot of details that can not be completely specified in this description.  The earlier you start, the sooner you will get the feedback you need to complete this assignment.

UML Class Diagram

Submit a UML class diagram by creating a pdf document named uml.pdf.  The deadline to submit this document is Wednesday, October 25, 6:00 pm.  Submit your design by selecting the entry P5-UML Design in the submit server.  The submit server does not accept pdf files, therefore you must place your uml.pdf file in zip file and then upload the zip file. Keep in mind that there is no late period to submit your design; you must submit by October 25, otherwise you will receive no credit for your design.  Make sure that the submission you provided is correct.  The submit server has an option to download any submissions you have provided. 

You can create the UML class diagram using word, a drawing software, or any UML tool.  You will not get any extra credit for using a particular tool; just make sure you provide the pdf file we need.  In Windows environments you can create pdf files by using CutePDF Writer (free software available at: http://www.cutepdf.com/Products/CutePDF/writer.asp).

Make sure you include the Cruise class as part of your diagram.  Also, read the Cruise class javadoc documentation as this will provide additional information on what is expected from the database system.

Implementation

For this project you will implement a cruise line database system.  In this system, we keep track of passengers and personnel responsible for the operation of a cruise.  The cruise personnel is organized in three main groups: officers, room attendants, and engineers.  The cruise ship information maintained by the database is the name of the ship, and the number, type, and cost for each ship's room.  The database also keeps track of the ports of calls (schedule stops), and some miscellaneous information like dinner time.  Keep in mind that we are simplifying the actual information that is required to represent a real cruise database system.

For this project you get to decide what classes and/or interfaces you want to define and use.  However, there is one class that you must implement according to a set of provided specifications. This class is the Cruise class whose documentation you can find at Cruise class javadoc documentation.  This is the class through which we will test your implementation.  We have provided a driver in this description (and in the code distribution) that illustrates how to use the Cruise class to access the database system.  

The project's code distribution is available by checking out the project named p5. The code distribution provides you with the following:

Requirements

Project Requirements

Style Requirements


Submission

Submit your design by uploading the zip file described above.  Submit your project implementation using the submit project option associated with Eclipse.

Academic Integrity

Please make sure you read the academic integrity section of the syllabus so you understand what is permissible in our programming projects.  We want to remind you that we check your project against other students' projects and any case of academic dishonesty will be referred to the University's Office of Judicial Programs.

Sample Driver

Driver.java

package cruise;
/**
 * Driver - Class that provides an example of how we can use the Cruise class.
 * 
 * @author cmsc132 Fall 2006
 * Copyright (C) 2006 University of Maryland
 * 
 */
public class Driver {
	public static void main(String[] args) {	
		String shipName = "Majesty";
		int windowRooms = 2, interiorRooms = 4;
		double windowRoomCost = 150.00, interiorRoomCost = 200.00;
		String[] portsOfCalls = {"Miami", "Bahamas", "Key West", "Miami"};
		String dinnerTime = "7:00pm";
		
		System.out.println("======================================================================");
		Cruise cruise = new Cruise(shipName, windowRooms, interiorRooms,windowRoomCost, interiorRoomCost,
								   portsOfCalls, dinnerTime);
		System.out.println(cruise.getShipInfo());	
		
		
		System.out.println("======================================================================");
		cruise.addOfficer("Smith,Rose", "45th Street NW Washington FL", 40, 'F', "Captain", "ClassA", 10, 75000); 
		cruise.addOfficer("Robinson,Jack", "5th Ave Long Beach CA", 35, 'M', "First Officer", "ClassB", 7, 45000);
		System.out.println(cruise.getPeople('O'));
		
		
		System.out.println("======================================================================");
		String officerInfo = cruise.find("Robinson,Jack");
		if (officerInfo != null) 
			System.out.println(officerInfo);
		else
			System.out.println("Officer not found");
		
		System.out.println("======================================================================");
		cruise.remove("Robinson,Jack");
		System.out.println(cruise.getPeople('O'));
		
		
		System.out.println("======================================================================");
		cruise.addEngineer("Porter,Carlos", "6000 St Greenbelt NC", 35, 'M', 4, "12:30pm", "8:30pm", 3, 35000, "Electrical");
		cruise.addEngineer("Borland,Kathy", "7000 St Bethesda MD", 25, 'F', 2, "8:30am", "4:30pm", 2, 30000, "Mechanical");
		cruise.addRoomAttendant("Lucas,Tom", "3rd Ave Wisconsin CA", 21, 'M', 3, "8:30am", "4:30pm", 1, 25000, new int[]{2,3}, 2);
		System.out.println(cruise.getPeople('E'));
		System.out.println(cruise.getPeople('R'));
		
		
		System.out.println("======================================================================");		
		cruise.addPassenger("Perez,Rachel", "6000 St Bethesda MD", 45, 'F', 'I');
		cruise.addPassenger("Ford,Tim", "8000 St Silver Spring MD", 25, 'M', 'W');
		System.out.println(cruise.getPeople('P'));
		
		
		System.out.println("======================================================================");
		cruise.addToPassengerBill("Perez,Rachel", 175);
		System.out.println(cruise.getPeople('P'));
	}
}

Output

======================================================================
Ship's Name: Majesty
Room(s):
Room Info: Number: 1, Type: W, Occupied: false, Cost: $150.00
Room Info: Number: 2, Type: W, Occupied: false, Cost: $150.00
Room Info: Number: 3, Type: I, Occupied: false, Cost: $200.00
Room Info: Number: 4, Type: I, Occupied: false, Cost: $200.00
Room Info: Number: 5, Type: I, Occupied: false, Cost: $200.00
Room Info: Number: 6, Type: I, Occupied: false, Cost: $200.00
Ports of Call:
Miami
Bahamas
Key West
Miami
Dinner Time: 7:00pm
======================================================================
Name: Robinson,Jack
Address: 5th Ave Long Beach CA
Age: 35, Sex: M
Rank: First Officer, ShipRestriction: ClassB, YearsOfService: 7, Salary: $45,000.00
====================================================
Name: Smith,Rose
Address: 45th Street NW Washington FL
Age: 40, Sex: F
Rank: Captain, ShipRestriction: ClassA, YearsOfService: 10, Salary: $75,000.00
======================================================================
Name: Robinson,Jack
Address: 5th Ave Long Beach CA
Age: 35, Sex: M
Rank: First Officer, ShipRestriction: ClassB, YearsOfService: 7, Salary: $45,000.00
======================================================================
Name: Smith,Rose
Address: 45th Street NW Washington FL
Age: 40, Sex: F
Rank: Captain, ShipRestriction: ClassA, YearsOfService: 10, Salary: $75,000.00
======================================================================
Name: Borland,Kathy
Address: 7000 St Bethesda MD
Age: 25, Sex: F, YearsOfService: 2, Salary: $30,000.00
Assigned Deck: 2, Shift: StartTime: 8:30am, EndTime: 4:30pm
Specialty: Mechanical
====================================================
Name: Porter,Carlos
Address: 6000 St Greenbelt NC
Age: 35, Sex: M, YearsOfService: 3, Salary: $35,000.00
Assigned Deck: 4, Shift: StartTime: 12:30pm, EndTime: 8:30pm
Specialty: Electrical
Name: Lucas,Tom
Address: 3rd Ave Wisconsin CA
Age: 21, Sex: M, YearsOfService: 1, Salary: $25,000.00
Assigned Deck: 3, Shift: StartTime: 8:30am, EndTime: 4:30pm
Daily Rounds: 2
Room(s):
Room Info: Number: 2, Type: W, Occupied: false, Cost: $150.00
Room Info: Number: 3, Type: I, Occupied: false, Cost: $200.00
======================================================================
Name: Ford,Tim
Address: 8000 St Silver Spring MD
Age: 25, Sex: M
Room Info: Number: 1, Type: W, Occupied: true, Cost: $150.00
Bill: $150.00
====================================================
Name: Perez,Rachel
Address: 6000 St Bethesda MD
Age: 45, Sex: F
Room Info: Number: 3, Type: I, Occupied: true, Cost: $200.00
Bill: $200.00
======================================================================
Name: Ford,Tim
Address: 8000 St Silver Spring MD
Age: 25, Sex: M
Room Info: Number: 1, Type: W, Occupied: true, Cost: $150.00
Bill: $150.00
====================================================
Name: Perez,Rachel
Address: 6000 St Bethesda MD
Age: 45, Sex: F
Room Info: Number: 3, Type: I, Occupied: true, Cost: $200.00
Bill: $375.00