Question
public class Cruise // Instance Variables private String cruiseName; private String cruise shipName; private string departure Port; private String destination; private String returnport; // Constructor
public class Cruise // Instance Variables private String cruiseName; private String cruise shipName; private string departure Port; private String destination; private String returnport; // Constructor - default Cruise () { } // Constructor - full Cruise (String tCruiseName, String tshipName, String t Departure, String tDestination, String tReturn) ! cruiseName = tCruiseName; cruiseshipName = tshipName; departure Port = t Departure; destination = t Destination; return Port = tReturn; } // Accessors public String getCruiseName() { return cruiseName; public String getCruise shipName() { return cruise shipName; public String get Departure Port() ( return departure Port; } public string get Destination () ! return destination; public string getReturn Port() { return returnPort; } // Mutators public void setCruiseName (String tvar) { cruiseName = tvar; public void setCruise ShipName(String tvar){ cruise shipName = tvar; public void set Departure Port(String tvar) departure Port = tvar; 3 public void set Destination(String tVar) ( destination = tvar; public void setCruise shipName(String tvar) ! cruise shipName = tvar; } public void setDepartureport(String tvar) departurePort = tvar; } public void set Destination(String tvar) { destination = tvar; } public void setReturn Port(String tvar) { return Port = tvar; } // print cruise details public void printCruise Details() { // complete this method } 77 method added to print ship's name vice memory address @Override public String toString() [ return cruiseName; } public class Passenger ! // Instance variables private String passenger Name; private String passengerCruise; private String passenger RoomType; // Constructor - default Passenger() { I // Constructor - full Passenger (String pName, string pcruise, String pRoomType) { passenger Name = pName; passengerCruige = pCruise; passenger RoomType = p RoomType; // should be BAL, Ov, STE, or INT ) // Accessors public string got PassengerName() { return passenger Name; } public String getPassenger Cruise () { return passengerCruise; 3 public String getPassengerRoom'lype() { return passenger RoomType; } // Mutators public void set Passenger Name (String tvar) { passengerName = tvar; ) public void setPassenger Cruise (String tvar) ( passengerCruise = tvar; } public void set Passenger RoomType (String tvar) ! passengerRoomType = tvar; // print method public void print Passenger () ( int spaceCount; String spaces1 = ""; String spaces2 = ""; spaceCount = 20 - passenger Name.length(); for (int i = 1; i =>=>=>;>=> shipList = new ArrayList(): private static ArrayList cruiselist = new ArrayList(); private static ArrayList passengerList = new ArrayList(); public static void main(String args) initializeShiptist initializeCruiseList initialize Passenger List w initial ships / initial cruises initial passengers // add loop and code here that accepts and validates user input // and takes the appropriate action include appropriate // user feedback and rodisplay the menu as needed // hardcoded ship data for testing // Initialize ship list public static void initializeshipList() { add("Candy Cane", 20, 10, 10, 60, true); add("Peppermint Stick", 10, 20, 5, 40, true); add("Bon Bon", 12, 18, 2, 24, false); add("Candy Corn", 12, 18, 2, 24, false): 1 // hardcoded cruine data for testing 17 Initialize cruise list public static void initializeCruiselist() { Cruise newCruise = new Cruise ("Southern Swirl", "Candy Cane", "Miami", "Cuba", "Miami"); eruiseList.add(newcruine); 1 // hardcoded cruise data for testing // Initialize passenger list public static void initializePassengerlist Passenger newPassengerl = new Passenger ("Neo Anderson". "Southern Swirl", "STE); passengerlist.add(newPassengeri); Passenger newPassenger2 new Passenger ("Trinity", "Southern Swirl", "SE") passengerList.add(newPassenger 2): Passenger newPassenger3 = new Passenger ("Morpheus", "Southern Swirl", "BAL"); passengerList.add(newPassenger3); } // custom method to add ships to the shipList ArrayList public static void add (String tName, int tBalcony, int tOceanview, int tsuite, int tInterior, boolean tInService) Ship newship = new Ship (tName, tBalcony, tOceanview, tSuite, tInterior, tinservice); shipList.add(newShip); } public static void printshapList (String list Type) { 7/ printshipList() method prints list of ships from the // shipList ArrayList. There are three different outputs // based on the listType String parameter: // name prints a list of ship names only // active prints a list of ship names that are "in service" // full prints tabbed data on all ships if (shipList.size(1) System.out.println(" There are no Ships to print."); return; am if (listType == "name") [ System.out.println(" SHIP LIST - Name"); for (int i = 0; i
The Luxury Ocean Cruise Outings company has provided Global Rain with a software specification document that details a menu-driven software application. Other developers on your software development team have already begun this project by creating the Ship, Cruise, Passenger, and Driver classes. You will modify the classes by including attributes and their proper data structures, writing methods to perform required functionality and behavior, and making sure that your program performs input validation and exception handling.
System Specification Document
Overview
Our mission at Luxury Ocean Cruise Outings is to provide the accurate and efficient ability to coordinate cruise bookings for our growing list of affiliate luxury cruise ship owners and cruise lines. We desire a simple menu-based system to perform core functions that are essential to our daily operations.
The envisioned system will include three primary components: ships, cruises, and passengers. The Luxury Ocean Cruise Outings company does not own ships; instead, it creates cruises using available ships. Once a ship is placed in service, it is available for cruises. Passengers can be added to cruises. Here are the relationships of these components:
Ships have unique names.
Cruises have unique names and are assigned to ships.
Ships can have multiple cruises.
Each ship has a finite number of passenger cabins (Balcony, Ocean View, Suite, and
Interior). Overbooking is not permitted.
Passengers are assigned to cruises.
System Menu
We require a simple text-based menu system that should resemble the illustration below. A text version of this table is also available.
What to Submit
To complete this project, you must submit the following:
Note: All class files must be submitted because the entire package of files is required for the application to run.
Driver.java Class File
Submit your modified Driver.java class file. Be sure to include in-line comments for all your changes and additions.
Cruise.java Class File
Submit your modified Cruise.java class file. Be sure to include in-line comments for all your changes and additions.
Ship.java Class File
Submit the Ship.java class file, even though you were not required to make changes to it for this project.
Passenger.java Class File
Submit the Passenger.java class file, even though you were not required to make changes to it for this project.
cruise
passenger
ship
driver
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started