SlideShare a Scribd company logo
1 of 34
IT 145 Project Three Guide
Use this step-by-step guide to complete all the methods needed
for the software application’s
menu system.
TIP: As you work on your code, you can add sample data to test
your code changes. Remember
that every time you exit the program, your sample data will be
cleared. To avoid this issue, it is
recommended that you hard-code your sample data as illustrated
in the beginning of the
Driver.java file. Some hardcoded data has already been created
for you, but you may add more
if you would like. Look for these in-line comments at the start
of the code:
// hardcoded ship data for testing
// Initialize ship list
Part One: Complete the printCruiseDetails() Method
1. Open the Cruise.java file. Pay attention to the variable names
and the code for the
constructors, accessors, and mutators, which have already been
created by your
development team. See below for where you will add code to
finish the
printCruiseDetails() method.
// print cruise details
public void printCruiseDetails() {
// complete this method
}
2. Next, review the required functionality of the “Print Cruise
Details” menu option below.
Menu Option Functionality
ts a list, each cruise on a separate
row
variables:
cruise name, cruise ship name, departure port, destination, and
return
port
3. Print Cruise Details Method: Write code for the
printCruiseDetails() method. When your
code is complete, test the output by running the Driver.java
class. Be sure the
completed method does the following:
a. Prints console output of all cruises and their details or, if
there are no cruises in
the inventory, the output states this to the user
b. Prints the output in an easy-to-read format for the end users
(for example, easy-
to-read output would present data in aligned columns)
TIP: Within the Ship.java file, there is a printShipData() method
that is very similar to the
method you are tasked with creating. You can refer to that
method as an example.
4. Industry Standard Best Practices: To ensure clarity,
consistency, and efficiency among
all software developers, your code must do the following:
a. Follow appropriate naming conventions for variables and
methods
b. Include descriptive in-line comments for all code you create
and modify
Part Two: Complete the printShipList() Method
1. Open the Driver.java file. See below for where you will add
code to finish the
printShipList() method.
} else if (listType == "active") {
System.out.println("nnSHIP LIST - Active");
// complete this code block
2. Next, review the required functionality of the “Print Ship
List” menu option below.
Menu Option Validation Check(s) Functionality
Print Ship In Service
List
If no ships are in the inventory,
informs the user
Prints a list consisting of all ship names that
are in service
3. Print Ship List Method: Complete the code for the
printShipList() method. When your
code is complete, test the output. Be sure that the completed
method provides console
output that returns ship details based on the String value passed
to the method.
TIP: The printShipList() method already supports printing ship
names and a full ship list.
You can review the code as you edit the printShipList() to
support printing ships in
service. See below for an example of the system’s printed
output for the full ship list.
Actual results do not need to match this example exactly. A text
version of this table is
also available.
4. Industry Standard Best Practices: To ensure clarity,
consistency, and efficiency among
all software developers, your code must do the following:
a. Follow appropriate naming conventions for variables and
methods
b. Include descriptive in-line comments for all code you create
and modify
Part Three: Complete the addShip() Method
1. In the Driver.java file, see below for where you will add code
to finish the addShip()
method.
// Add a New Ship
public static void addShip() {
// complete this method
}
https://learn.snhu.edu/d2l/lor/viewer/view.d2l?ou=6606&loIdent
Id=24106
2. Next, review the required functionality of the “Add Ship”
menu option below.
Menu Option Validation Check(s) Functionality
Add Ship - Ensures ship does not already exist in our system
- Ensures all class variables are populated
Adds ship to system
3. Add Ship Method: Write the code for the addShip() method.
When your code is
complete, test the output. Be sure that the completed method
does the following:
a. Adds a new Ship object
b. Includes all class variables
c. Updates appropriate ArrayList
TIP: You can refer to the Ship.java class constructor to make
sure you have included all
variables.
4. Industry Standard Best Practices: To ensure clarity,
consistency, and efficiency among
all software developers, your code must do the following:
a. Ensure that all user input is validated with appropriate
feedback to the user
b. Include exception handling
c. Follow appropriate naming conventions for variables and
methods
d. Include descriptive in-line comments for all code you create
and modify
Part Four: Complete the addCruise() Method
1. In the Driver.java file, see below for where you will add code
to finish the addCruise()
method.
// Adda New Cruise
public static void addCruise() {
// complete this method
}
2. Next, review the required functionality of the “Add Cruise”
menu option below.
Menu Option Validation Check(s) Functionality
Add Cruise - Ensures cruise does not already exist in
our system
- Ensures all class variables are populated
Adds cruise to system
3. Add Cruise Method: Write the code for the addCruise()
method. When your code is
complete, test the output. Be sure that the completed method
does the following:
a. Prompts the user for input
b. Requires all class variables when creating a cruise
c. Validates the ship name and ensures it is in service
d. Ensures ship name is not already assigned a cruise
e. Adds the new cruise to the cruiseList ArrayList if validation
checks pass
4. Industry Standard Best Practices: To ensure clarity,
consistency, and efficiency among
all software developers, your code must do the following:
a. Ensure that all user input is validated with appropriate
feedback to the user
b. Include exception handling
c. Follow appropriate naming conventions for variables and
methods
d. Include descriptive in-line comments for all code you create
and modify
Part Five: Complete the main() Method
1. At the beginning of the Driver.java file, see below for where
you will add code to finish
the main() method.
public static void main(String[] args) {
initializeShipList(); // initial ships
initializeCruiseList(); // initial cruises
initializePassengerList(); // initial passengers
// add loop and code here that accepts and validates user
input
// and takes the appropriate action. include appropriate
// user feedback and redisplay the menu as needed
2. Main Method: Complete the code for the main() method.
When your code is complete,
test the output. Be sure that the completed method does the
following:
a. Includes a loop that allows the user to interact with the menu
until they signal
that they want to exit the system
b. Maps user input to the specified functionality based on the all
menu options
listed below. A text version of this table is also available.
Note: The methods for Edit Ship, Edit Cruise, and Edit
Passenger do not need to be
completed but should still be mapped. When you test your
menu, if you enter 2, 4, or 6
for a menu selection, you should get a response that the “feature
is not yet
implemented.”
3. Industry Standard Best Practices: To ensure clarity,
consistency, and efficiency among
all software developers, your code must do the following:
a. Ensure that all user input is validated with appropriate
feedback to the user
b. Follow appropriate naming conventions for variables and
methods
c. Include descriptive in-line comments for all code you create
and modify
Part Six: Submission
Upon completing your code for each class file, review the What
to Submit section of the Project
Three overview and submit all files to the Project Three
submission.
https://learn.snhu.edu/d2l/lor/viewer/view.d2l?ou=6606&loIdent
Id=24108
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. Comment by Gutschow, Molly: Jordan: Link to
IT 145 System Menu Text Version.
CruiseShipProject/.classpath
CruiseShipProject/.project
CruiseShipProject
org.eclipse.jdt.core.javabuilder
org.eclipse.jdt.core.javanature
CruiseShipProject/.settings/org.eclipse.jdt.core.prefs
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enable
d
org.eclipse.jdt.core.compiler.codegen.targetPlatform=9
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=9
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=9
CruiseShipProject/bin/Cruise.classpublicsynchronizedclass
Cruise {
private String cruiseName;
private String cruiseShipName;
private String departurePort;
private String destination;
private String returnPort;
void Cruise();
void Cruise(String, String, String, String, String);
public String getCruiseName();
public String getCruiseShipName();
public String getDeparturePort();
public String getDestination();
public String getReturnPort();
public void setCruiseName(String);
public void setCruiseShipName(String);
public void setDeparturePort(String);
public void setDestination(String);
public void setReturnPort(String);
public void printCruiseDetails();
public String toString();
}
CruiseShipProject/bin/Driver.classpublicsynchronizedclass
Driver {
privatestatic java.util.ArrayList shipList;
privatestatic java.util.ArrayList cruiseList;
privatestatic java.util.ArrayList passengerList;
static void <clinit>();
public void Driver();
publicstatic void main(String[]);
publicstatic void initializeShipList();
publicstatic void initializeCruiseList();
publicstatic void initializePassengerList();
publicstatic void add(String, int, int, int, int, boolean);
publicstatic void printShipList(String);
publicstatic void printCruiseList(String);
publicstatic void printPassengerList();
publicstatic void displayMenu();
publicstatic void addShip();
publicstatic void editShip();
publicstatic void addCruise();
publicstatic void editCruise();
publicstatic void addPassenger();
publicstatic void editPassenger();
publicstatic boolean isANumber(String);
}
CruiseShipProject/bin/Passenger.classpublicsynchronizedclass
Passenger {
private String passengerName;
private String passengerCruise;
private String passengerRoomType;
void Passenger();
void Passenger(String, String, String);
public String getPassengerName();
public String getPassengerCruise();
public String getPassengerRoomType();
public void setPassengerName(String);
public void setPassengerCruise(String);
public void setPassengerRoomType(String);
public void printPassenger();
public String toString();
}
CruiseShipProject/bin/Ship.classpublicsynchronizedclass Ship {
private String shipName;
private int roomBalcony;
private int roomOceanView;
private int roomSuite;
private int roomInterior;
private boolean inService;
void Ship();
void Ship(String, int, int, int, int, boolean);
public String getShipName();
public int getRoomBalcony();
public int getRoomOceanView();
public int getRoomSuite();
public int getRoomInterior();
public boolean getInService();
public void setShipName(String);
public void setRoomBalcony(int);
public void setRoomOceanView(int);
public void setRoomSuite(int);
public void setRoomInterior(int);
public void setInService(boolean);
public void printShipData();
public String toString();
}
CruiseShipProject/src/Cruise.javaCruiseShipProject/src/Cruise.j
avapublicclassCruise{
// Class Variables
privateString cruiseName;
privateString cruiseShipName;
privateString departurePort;
privateString destination;
privateString returnPort;
// Constructor - default
Cruise(){
}
// Constructor - full
Cruise(String tCruiseName,String tShipName,String tDeparture,
String tDestination,String tReturn){
cruiseName = tCruiseName;
cruiseShipName = tShipName;
departurePort = tDeparture;
destination = tDestination;
returnPort = tReturn;
}
// Accessors
publicString getCruiseName(){
return cruiseName;
}
publicString getCruiseShipName(){
return cruiseShipName;
}
publicString getDeparturePort(){
return departurePort;
}
publicString getDestination(){
return destination;
}
publicString getReturnPort(){
return returnPort;
}
// Mutators
publicvoid setCruiseName(String tVar){
cruiseName = tVar;
}
publicvoid setCruiseShipName(String tVar){
cruiseShipName = tVar;
}
publicvoid setDeparturePort(String tVar){
departurePort = tVar;
}
publicvoid setDestination(String tVar){
destination = tVar;
}
publicvoid setReturnPort(String tVar){
returnPort = tVar;
}
// print cruise details
publicvoid printCruiseDetails(){
// complete this method
}
// method added to print ship's name vice memory address
@Override
publicString toString(){
return cruiseName;
}
}
CruiseShipProject/src/Driver.javaCruiseShipProject/src/Driver.j
avaimport java.util.ArrayList;
import java.util.Scanner;
importstatic java.lang.Integer.parseInt;
publicclassDriver{
// class variables (add more as needed)
privatestaticArrayList<Ship> shipList =newArrayList();
privatestaticArrayList<Cruise> cruiseList =newArrayList();
privatestaticArrayList<Passenger> passengerList =newArrayList
();
publicstaticvoid main(String[] args){
initializeShipList();// initial ships
initializeCruiseList();// initial cruises
initializePassengerList();// initial passengers
// add loop and code here that accepts and validates user input
// and takes the appropriate action. include appropriate
// user feedback and redisplay the menu as needed
}
// hardcoded ship data for testing
// Initialize ship list
publicstaticvoid initializeShipList(){
add("Candy Cane",20,40,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);
}
// hardcoded cruise data for testing
// Initialize cruise list
publicstaticvoid initializeCruiseList(){
Cruise newCruise =newCruise("Southern Swirl","Candy Cane","
Miami","Cuba","Miami");
cruiseList.add(newCruise);
}
// hardcoded cruise data for testing
// Initialize passenger list
publicstaticvoid initializePassengerList(){
Passenger newPassenger1 =newPassenger("Neo Anderson","Sou
thern Swirl","STE");
passengerList.add(newPassenger1);
Passenger newPassenger2 =newPassenger("Trinity","Southern S
wirl","STE");
passengerList.add(newPassenger2);
Passenger newPassenger3 =newPassenger("Morpheus","Souther
n Swirl","BAL");
passengerList.add(newPassenger3);
}
// custom method to add ships to the shipList ArrayList
publicstaticvoid add(String tName,int tBalcony,int tOceanView,
int tSuite,int tInterior,boolean tInService){
Ship newShip =newShip(tName, tBalcony, tOceanView, tSuite,
tInterior, tInService);
shipList.add(newShip);
}
publicstaticvoid printShipList(String listType){
// 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("nThere are no ships to print.");
return;
}
if(listType =="name"){
System.out.println("nnSHIP LIST - Name");
for(int i =0; i < shipList.size(); i++){
System.out.println(shipList.get(i));
}
}elseif(listType =="active"){
System.out.println("nnSHIP LIST - Active");
// complete this code block
}elseif(listType =="full"){
System.out.println("nnSHIP LIST - Full");
System.out.println("-----------------------------------------------");
System.out.println(" Number of Rooms In");
System.out.print("SHIP NAME Bal OV Ste Int Servic
e");
System.out.println("n-----------------------------------------------
");
for(Ship eachShip: shipList)
eachShip.printShipData();
}else
System.out.println("nnError: List type not defined.");
}
publicstaticvoid printCruiseList(String listType){
if(cruiseList.size()<1){
System.out.println("nThere are no cruises to print.");
return;
}
if(listType =="list"){
System.out.println("nnCRUISE LIST");
for(int i=0; i < cruiseList.size(); i++){
System.out.println(cruiseList.get(i));
}
}elseif(listType =="details"){
System.out.println("nnCRUISE LIST - Details");
System.out.println("---------------------------------------------------
---------------------------------------");
System.out.println(" |--------------------
--PORTS-----------------------|");
System.out.print("CRUISE NAME SHIP NAME DE
PARTURE DESTINATION RETURN");
System.out.println("n-------------------------------------------------
----------------------------------------");
for(Cruise eachCruise: cruiseList)
eachCruise.printCruiseDetails();
}else
System.out.println("nnError: List type not defined.");
}
publicstaticvoid printPassengerList(){
if(passengerList.size()<1){
System.out.println("nThere are no passengers to print.");
return;
}
System.out.println("nnPASSENGER LIST");
System.out.println("---------------------------------------------------
--");
System.out.print("PASSENGER NAME CRUISE R
OOM TYPE");
System.out.println("n-------------------------------------------------
----");
for(Passenger eachPassenger: passengerList)
eachPassenger.printPassenger();
}
// display text-based menu
publicstaticvoid displayMenu(){
System.out.println("nn");
System.out.println("tttLuxury Ocean Cruise Outings");
System.out.println("tttttSystem Menun");
System.out.println("[1] Add Ship [A] Print Ship Names"
);
System.out.println("[2] Edit Ship [B] Print Ship In Servic
e List");
System.out.println("[3] Add Cruise [C] Print Ship Full Li
st");
System.out.println("[4] Edit Cruise [D] Print Cruise List")
;
System.out.println("[5] Add Passenger [E] Print Cruise Deta
ils");
System.out.println("[6] Edit Passenger [F] Print Passenger L
ist");
System.out.println("[x] Exit System");
System.out.println("nEnter a menu selection: ");
}
// Add a New Ship
publicstaticvoid addShip(){
// complete this method
}
// Edit an existing ship
publicstaticvoid editShip(){
// This method does not need to be completed
System.out.println("The "Edit Ship" feature is not yet impleme
nted.");
}
// Add a New Cruise
publicstaticvoid addCruise(){
// complete this method
}
// Edit an existing cruise
publicstaticvoid editCruise(){
// This method does not need to be completed
System.out.println("The "Edit Cruise" feature is not yet imple
mented.");
}
// Add a New Passenger
publicstaticvoid addPassenger(){
Scanner newPassengerInput =newScanner(System.in);
System.out.println("Enter the new passenger's name: ");
String newPassengerName = newPassengerInput.nextLine();
// ensure new passenger name does not already exist
for(Passenger eachPassenger: passengerList){
if(eachPassenger.getPassengerName().equalsIgnoreCase(newPas
sengerName)){
System.out.println("That passenger is already in the system. Exi
ting to menu...");
return;// quits addPassenger() method processing
}
}
// get cruise name for passenger
System.out.println("Enter cruise name: ");
String newCruiseName = newPassengerInput.nextLine();
// ensure cruise exists
for(Cruise eachCruise: cruiseList){
if(eachCruise.getCruiseName().equalsIgnoreCase(newCruiseNa
me)){
// cruise does exist
}else{
System.out.println("That cruise does not exist in the system. Ex
iting to menu...");
return;// quits addPassenger() method processing
}
}
// get room type
System.out.println("Enter Room Type (BAL, OV, STE, or INT:
");
String room = newPassengerInput.nextLine();
// validate room type
if((room.equalsIgnoreCase("BAL"))||(room.equalsIgnoreCase("
OV"))||
(room.equalsIgnoreCase("STE"))||(room.equalsIgnoreCase("INT
"))){
// validation passed - add passenger
Passenger newPassenger =newPassenger(newPassengerName, ne
wCruiseName, room.toUpperCase());
passengerList.add(newPassenger);
}else{
System.out.println("Invalid input. Exiting to menu...");
return;// quits addPassenger() method processing
}
}
// Edit an existing passenger
publicstaticvoid editPassenger(){
// This method does not need to be completed
System.out.println("The "Edit Passenger" feature is not yet im
plemented.");
}
// Method to check if input is a number
publicstaticboolean isANumber(String str){
for(int i =0; i < str.length(); i++){
if(Character.isDigit(str.charAt(i))==false)
returnfalse;
}
returntrue;
}
}
CruiseShipProject/src/Passenger.javaCruiseShipProject/src/Pass
enger.javapublicclassPassenger{
// Class variables
privateString passengerName;
privateString passengerCruise;
privateString passengerRoomType;
// Constructor - default
Passenger(){
}
// Constructor - full
Passenger(String pName,String pCruise,String pRoomType){
passengerName = pName;
passengerCruise = pCruise;
passengerRoomType = pRoomType;// should be BAL, OV,
STE, or INT
}
// Accessors
publicString getPassengerName(){
return passengerName;
}
publicString getPassengerCruise(){
return passengerCruise;
}
publicString getPassengerRoomType(){
return passengerRoomType;
}
// Mutators
publicvoid setPassengerName(String tVar){
passengerName = tVar;
}
publicvoid setPassengerCruise(String tVar){
passengerCruise = tVar;
}
publicvoid setPassengerRoomType(String tVar){
passengerRoomType = tVar;
}
// print method
publicvoid printPassenger(){
int spaceCount;
String spaces1 ="";
String spaces2 ="";
spaceCount =20- passengerName.length();
for(int i =1; i <= spaceCount; i++){
spaces1 = spaces1 +" ";
}
spaceCount =20- passengerCruise.length();
for(int i =1; i <= spaceCount; i++){
spaces2 = spaces2 +" ";
}
System.out.println(passengerName + spaces1 + passengerCruise
+ spaces2 +
passengerRoomType);
}
// method added to print passenger's name vice memory address
@Override
publicString toString(){
return passengerName;
}
}
CruiseShipProject/src/Ship.javaCruiseShipProject/src/Ship.java
publicclassShip{
// Class Variables
privateString shipName;
privateint roomBalcony;
privateint roomOceanView;
privateint roomSuite;
privateint roomInterior;
privateboolean inService;
// Constructor - default
Ship(){
}
// Constructor - full
Ship(String tName,int tBalcony,int tOceanView,
int tSuite,int tInterior,boolean tInService){
shipName = tName;
roomBalcony = tBalcony;
roomOceanView = tOceanView;
roomSuite = tSuite;
roomInterior = tInterior;
inService = tInService;
}
// Accessors
publicString getShipName(){
return shipName;
}
publicint getRoomBalcony(){
return roomBalcony;
}
publicint getRoomOceanView(){
return roomOceanView;
}
publicint getRoomSuite(){
return roomSuite;
}
publicint getRoomInterior(){
return roomInterior;
}
publicboolean getInService(){
return inService;
}
// Mutators
publicvoid setShipName(String tVar){
shipName = tVar;
}
publicvoid setRoomBalcony(int tVar){
roomBalcony = tVar;
}
publicvoid setRoomOceanView(int tVar){
roomOceanView = tVar;
}
publicvoid setRoomSuite(int tVar){
roomSuite = tVar;
}
publicvoid setRoomInterior(int tVar){
roomInterior = tVar;
}
publicvoid setInService(boolean tVar){
inService = tVar;
}
// print method
publicvoid printShipData(){
int spaceCount;
String spaces ="";
spaceCount =20- shipName.length();
for(int i =1; i <= spaceCount; i++){
spaces = spaces +" ";
}
System.out.println(shipName + spaces + roomBalcony +"t"+
roomOceanView +"t"+ roomSuite +"t"+
roomInterior +"tt"+ inService);
}
// method added to print ship's name vice memory address
@Override
publicString toString(){
return shipName;
}
}
Project Three Guidelines and Rubric
Competency
In this project, you will demonstrate your mastery of the
following competency:
• Write programs using object-oriented conventions in
accordance with
industry standard best practices
Scenario
You work for Global Rain, a software
engineering company that specializes in
custom software design and development. As a
junior software developer, you are part of a
software development team at Global Rain that
collaborates to create software solutions for
entrepreneurs, businesses and government
agencies around the world.
Your Global Rain software development team
has been asked to develop a menu-driven
system for the Luxury Ocean Cruise Outings company. This
company
coordinates cruise bookings for luxury ship owners and cruise
lines. As a
returning customer for Global Rain, Luxury Ocean Cruise
Outings has
requested a simple menu-based system to perform core
functions that are
IT-145-T1604 Found in App Develo… RL
Reflect in ePortfolio Download Print
Open with docReader
Activity Details
You have viewed this topic
Last Visited Oct 10, 2019 8:21 PM

More Related Content

Similar to IT 145 Project Three Guide Use this step-by-step guide.docx

Getting started with_testcomplete
Getting started with_testcompleteGetting started with_testcomplete
Getting started with_testcomplete
ankit.das
 
Final Internship Presentation
Final Internship PresentationFinal Internship Presentation
Final Internship Presentation
Thekra Alqaeed
 

Similar to IT 145 Project Three Guide Use this step-by-step guide.docx (20)

000 252
000 252000 252
000 252
 
Module 4: Introduction to ASP.NET 3.5 (Material)
Module 4: Introduction to ASP.NET 3.5 (Material)Module 4: Introduction to ASP.NET 3.5 (Material)
Module 4: Introduction to ASP.NET 3.5 (Material)
 
ScalaUA - distage: Staged Dependency Injection
ScalaUA - distage: Staged Dependency InjectionScalaUA - distage: Staged Dependency Injection
ScalaUA - distage: Staged Dependency Injection
 
Implementation procedure of OPNET, and Qualnet
Implementation procedure of OPNET, and QualnetImplementation procedure of OPNET, and Qualnet
Implementation procedure of OPNET, and Qualnet
 
Getting started with_testcomplete
Getting started with_testcompleteGetting started with_testcomplete
Getting started with_testcomplete
 
Angular performance slides
Angular performance slidesAngular performance slides
Angular performance slides
 
Final Internship Presentation
Final Internship PresentationFinal Internship Presentation
Final Internship Presentation
 
The ActionScript Conference 08, Singapore - Developing ActionScript 3 Mash up...
The ActionScript Conference 08, Singapore - Developing ActionScript 3 Mash up...The ActionScript Conference 08, Singapore - Developing ActionScript 3 Mash up...
The ActionScript Conference 08, Singapore - Developing ActionScript 3 Mash up...
 
Automation tips
Automation tipsAutomation tips
Automation tips
 
ASP DOT NET
ASP DOT NETASP DOT NET
ASP DOT NET
 
Week 2
Week 2Week 2
Week 2
 
Express 070 536
Express 070 536Express 070 536
Express 070 536
 
Asp dot-net core problems and fixes
Asp dot-net core problems and fixes Asp dot-net core problems and fixes
Asp dot-net core problems and fixes
 
Bpc 10.0 NW Mass User Management tool
Bpc 10.0 NW Mass User Management toolBpc 10.0 NW Mass User Management tool
Bpc 10.0 NW Mass User Management tool
 
Overview of MVC Framework - by software outsourcing company india
Overview of MVC Framework - by software outsourcing company indiaOverview of MVC Framework - by software outsourcing company india
Overview of MVC Framework - by software outsourcing company india
 
Angularjs2 presentation
Angularjs2 presentationAngularjs2 presentation
Angularjs2 presentation
 
C++ Lab Maual.pdf
C++ Lab Maual.pdfC++ Lab Maual.pdf
C++ Lab Maual.pdf
 
C++ Lab Maual.pdf
C++ Lab Maual.pdfC++ Lab Maual.pdf
C++ Lab Maual.pdf
 
32916
3291632916
32916
 
Homestead demo
Homestead demoHomestead demo
Homestead demo
 

More from vrickens

1000 words only due by 5314 at 1200 estthis is a second part to.docx
1000 words only due by 5314 at 1200 estthis is a second part to.docx1000 words only due by 5314 at 1200 estthis is a second part to.docx
1000 words only due by 5314 at 1200 estthis is a second part to.docx
vrickens
 
10.1. In a t test for a single sample, the samples mean.docx
10.1. In a t test for a single sample, the samples mean.docx10.1. In a t test for a single sample, the samples mean.docx
10.1. In a t test for a single sample, the samples mean.docx
vrickens
 
100 WORDS OR MOREConsider your past experiences either as a studen.docx
100 WORDS OR MOREConsider your past experiences either as a studen.docx100 WORDS OR MOREConsider your past experiences either as a studen.docx
100 WORDS OR MOREConsider your past experiences either as a studen.docx
vrickens
 
100 word responseChicago style citingLink to textbook httpbo.docx
100 word responseChicago style citingLink to textbook httpbo.docx100 word responseChicago style citingLink to textbook httpbo.docx
100 word responseChicago style citingLink to textbook httpbo.docx
vrickens
 
100 word response to the followingBoth perspectives that we rea.docx
100 word response to the followingBoth perspectives that we rea.docx100 word response to the followingBoth perspectives that we rea.docx
100 word response to the followingBoth perspectives that we rea.docx
vrickens
 
100 word response to the followingThe point that Penetito is tr.docx
100 word response to the followingThe point that Penetito is tr.docx100 word response to the followingThe point that Penetito is tr.docx
100 word response to the followingThe point that Penetito is tr.docx
vrickens
 
100 word response to the folowingMust use Chicago style citing an.docx
100 word response to the folowingMust use Chicago style citing an.docx100 word response to the folowingMust use Chicago style citing an.docx
100 word response to the folowingMust use Chicago style citing an.docx
vrickens
 
100 word response using textbook Getlein, Mark. Living with Art, 9t.docx
100 word response using textbook Getlein, Mark. Living with Art, 9t.docx100 word response using textbook Getlein, Mark. Living with Art, 9t.docx
100 word response using textbook Getlein, Mark. Living with Art, 9t.docx
vrickens
 
100 word response to the following. Must cite properly in MLA.Un.docx
100 word response to the following. Must cite properly in MLA.Un.docx100 word response to the following. Must cite properly in MLA.Un.docx
100 word response to the following. Must cite properly in MLA.Un.docx
vrickens
 
100 original, rubric, word count and required readings must be incl.docx
100 original, rubric, word count and required readings must be incl.docx100 original, rubric, word count and required readings must be incl.docx
100 original, rubric, word count and required readings must be incl.docx
vrickens
 
10-12 slides with Notes APA Style ReferecesThe prosecutor is getti.docx
10-12 slides with Notes APA Style ReferecesThe prosecutor is getti.docx10-12 slides with Notes APA Style ReferecesThe prosecutor is getti.docx
10-12 slides with Notes APA Style ReferecesThe prosecutor is getti.docx
vrickens
 

More from vrickens (20)

1000 words, 2 referencesBegin conducting research now on your .docx
1000 words, 2 referencesBegin conducting research now on your .docx1000 words, 2 referencesBegin conducting research now on your .docx
1000 words, 2 referencesBegin conducting research now on your .docx
 
1000 words only due by 5314 at 1200 estthis is a second part to.docx
1000 words only due by 5314 at 1200 estthis is a second part to.docx1000 words only due by 5314 at 1200 estthis is a second part to.docx
1000 words only due by 5314 at 1200 estthis is a second part to.docx
 
1000 words with refernceBased on the American constitution,” wh.docx
1000 words with refernceBased on the American constitution,” wh.docx1000 words with refernceBased on the American constitution,” wh.docx
1000 words with refernceBased on the American constitution,” wh.docx
 
10.1. In a t test for a single sample, the samples mean.docx
10.1. In a t test for a single sample, the samples mean.docx10.1. In a t test for a single sample, the samples mean.docx
10.1. In a t test for a single sample, the samples mean.docx
 
100 WORDS OR MOREConsider your past experiences either as a studen.docx
100 WORDS OR MOREConsider your past experiences either as a studen.docx100 WORDS OR MOREConsider your past experiences either as a studen.docx
100 WORDS OR MOREConsider your past experiences either as a studen.docx
 
1000 to 2000 words Research Title VII of the Civil Rights Act of.docx
1000 to 2000 words Research Title VII of the Civil Rights Act of.docx1000 to 2000 words Research Title VII of the Civil Rights Act of.docx
1000 to 2000 words Research Title VII of the Civil Rights Act of.docx
 
1000 word essay MlA Format.. What is our personal responsibility tow.docx
1000 word essay MlA Format.. What is our personal responsibility tow.docx1000 word essay MlA Format.. What is our personal responsibility tow.docx
1000 word essay MlA Format.. What is our personal responsibility tow.docx
 
100 wordsGoods and services that are not sold in markets.docx
100 wordsGoods and services that are not sold in markets.docx100 wordsGoods and services that are not sold in markets.docx
100 wordsGoods and services that are not sold in markets.docx
 
100 word responseChicago style citingLink to textbook httpbo.docx
100 word responseChicago style citingLink to textbook httpbo.docx100 word responseChicago style citingLink to textbook httpbo.docx
100 word responseChicago style citingLink to textbook httpbo.docx
 
100 word response to the followingBoth perspectives that we rea.docx
100 word response to the followingBoth perspectives that we rea.docx100 word response to the followingBoth perspectives that we rea.docx
100 word response to the followingBoth perspectives that we rea.docx
 
100 word response to the followingThe point that Penetito is tr.docx
100 word response to the followingThe point that Penetito is tr.docx100 word response to the followingThe point that Penetito is tr.docx
100 word response to the followingThe point that Penetito is tr.docx
 
100 word response to the folowingMust use Chicago style citing an.docx
100 word response to the folowingMust use Chicago style citing an.docx100 word response to the folowingMust use Chicago style citing an.docx
100 word response to the folowingMust use Chicago style citing an.docx
 
100 word response using textbook Getlein, Mark. Living with Art, 9t.docx
100 word response using textbook Getlein, Mark. Living with Art, 9t.docx100 word response using textbook Getlein, Mark. Living with Art, 9t.docx
100 word response using textbook Getlein, Mark. Living with Art, 9t.docx
 
100 word response to the following. Must cite properly in MLA.Un.docx
100 word response to the following. Must cite properly in MLA.Un.docx100 word response to the following. Must cite properly in MLA.Un.docx
100 word response to the following. Must cite properly in MLA.Un.docx
 
100 original, rubric, word count and required readings must be incl.docx
100 original, rubric, word count and required readings must be incl.docx100 original, rubric, word count and required readings must be incl.docx
100 original, rubric, word count and required readings must be incl.docx
 
100 or more wordsFor this Discussion imagine that you are speaki.docx
100 or more wordsFor this Discussion imagine that you are speaki.docx100 or more wordsFor this Discussion imagine that you are speaki.docx
100 or more wordsFor this Discussion imagine that you are speaki.docx
 
10. (TCOs 1 and 10) Apple, Inc. a cash basis S corporation in Or.docx
10. (TCOs 1 and 10) Apple, Inc. a cash basis S corporation in Or.docx10. (TCOs 1 and 10) Apple, Inc. a cash basis S corporation in Or.docx
10. (TCOs 1 and 10) Apple, Inc. a cash basis S corporation in Or.docx
 
10-12 slides with Notes APA Style ReferecesThe prosecutor is getti.docx
10-12 slides with Notes APA Style ReferecesThe prosecutor is getti.docx10-12 slides with Notes APA Style ReferecesThe prosecutor is getti.docx
10-12 slides with Notes APA Style ReferecesThe prosecutor is getti.docx
 
10-12 page paer onDiscuss the advantages and problems with trailer.docx
10-12 page paer onDiscuss the advantages and problems with trailer.docx10-12 page paer onDiscuss the advantages and problems with trailer.docx
10-12 page paer onDiscuss the advantages and problems with trailer.docx
 
10. Assume that you are responsible for decontaminating materials in.docx
10. Assume that you are responsible for decontaminating materials in.docx10. Assume that you are responsible for decontaminating materials in.docx
10. Assume that you are responsible for decontaminating materials in.docx
 

Recently uploaded

Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
MateoGardella
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
SanaAli374401
 

Recently uploaded (20)

APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 

IT 145 Project Three Guide Use this step-by-step guide.docx

  • 1. IT 145 Project Three Guide Use this step-by-step guide to complete all the methods needed for the software application’s menu system. TIP: As you work on your code, you can add sample data to test your code changes. Remember that every time you exit the program, your sample data will be cleared. To avoid this issue, it is recommended that you hard-code your sample data as illustrated in the beginning of the Driver.java file. Some hardcoded data has already been created for you, but you may add more if you would like. Look for these in-line comments at the start of the code: // hardcoded ship data for testing // Initialize ship list Part One: Complete the printCruiseDetails() Method
  • 2. 1. Open the Cruise.java file. Pay attention to the variable names and the code for the constructors, accessors, and mutators, which have already been created by your development team. See below for where you will add code to finish the printCruiseDetails() method. // print cruise details public void printCruiseDetails() { // complete this method } 2. Next, review the required functionality of the “Print Cruise Details” menu option below. Menu Option Functionality ts a list, each cruise on a separate row variables:
  • 3. cruise name, cruise ship name, departure port, destination, and return port 3. Print Cruise Details Method: Write code for the printCruiseDetails() method. When your code is complete, test the output by running the Driver.java class. Be sure the completed method does the following: a. Prints console output of all cruises and their details or, if there are no cruises in the inventory, the output states this to the user b. Prints the output in an easy-to-read format for the end users (for example, easy- to-read output would present data in aligned columns) TIP: Within the Ship.java file, there is a printShipData() method that is very similar to the method you are tasked with creating. You can refer to that method as an example.
  • 4. 4. Industry Standard Best Practices: To ensure clarity, consistency, and efficiency among all software developers, your code must do the following: a. Follow appropriate naming conventions for variables and methods b. Include descriptive in-line comments for all code you create and modify Part Two: Complete the printShipList() Method 1. Open the Driver.java file. See below for where you will add code to finish the printShipList() method. } else if (listType == "active") { System.out.println("nnSHIP LIST - Active"); // complete this code block 2. Next, review the required functionality of the “Print Ship List” menu option below. Menu Option Validation Check(s) Functionality
  • 5. Print Ship In Service List If no ships are in the inventory, informs the user Prints a list consisting of all ship names that are in service 3. Print Ship List Method: Complete the code for the printShipList() method. When your code is complete, test the output. Be sure that the completed method provides console output that returns ship details based on the String value passed to the method. TIP: The printShipList() method already supports printing ship names and a full ship list. You can review the code as you edit the printShipList() to support printing ships in service. See below for an example of the system’s printed output for the full ship list. Actual results do not need to match this example exactly. A text version of this table is
  • 6. also available. 4. Industry Standard Best Practices: To ensure clarity, consistency, and efficiency among all software developers, your code must do the following: a. Follow appropriate naming conventions for variables and methods b. Include descriptive in-line comments for all code you create and modify Part Three: Complete the addShip() Method 1. In the Driver.java file, see below for where you will add code to finish the addShip() method. // Add a New Ship public static void addShip() { // complete this method }
  • 7. https://learn.snhu.edu/d2l/lor/viewer/view.d2l?ou=6606&loIdent Id=24106 2. Next, review the required functionality of the “Add Ship” menu option below. Menu Option Validation Check(s) Functionality Add Ship - Ensures ship does not already exist in our system - Ensures all class variables are populated Adds ship to system 3. Add Ship Method: Write the code for the addShip() method. When your code is complete, test the output. Be sure that the completed method does the following: a. Adds a new Ship object b. Includes all class variables c. Updates appropriate ArrayList TIP: You can refer to the Ship.java class constructor to make sure you have included all
  • 8. variables. 4. Industry Standard Best Practices: To ensure clarity, consistency, and efficiency among all software developers, your code must do the following: a. Ensure that all user input is validated with appropriate feedback to the user b. Include exception handling c. Follow appropriate naming conventions for variables and methods d. Include descriptive in-line comments for all code you create and modify Part Four: Complete the addCruise() Method 1. In the Driver.java file, see below for where you will add code to finish the addCruise() method. // Adda New Cruise public static void addCruise() {
  • 9. // complete this method } 2. Next, review the required functionality of the “Add Cruise” menu option below. Menu Option Validation Check(s) Functionality Add Cruise - Ensures cruise does not already exist in our system - Ensures all class variables are populated Adds cruise to system 3. Add Cruise Method: Write the code for the addCruise() method. When your code is complete, test the output. Be sure that the completed method does the following: a. Prompts the user for input b. Requires all class variables when creating a cruise c. Validates the ship name and ensures it is in service d. Ensures ship name is not already assigned a cruise
  • 10. e. Adds the new cruise to the cruiseList ArrayList if validation checks pass 4. Industry Standard Best Practices: To ensure clarity, consistency, and efficiency among all software developers, your code must do the following: a. Ensure that all user input is validated with appropriate feedback to the user b. Include exception handling c. Follow appropriate naming conventions for variables and methods d. Include descriptive in-line comments for all code you create and modify Part Five: Complete the main() Method 1. At the beginning of the Driver.java file, see below for where you will add code to finish the main() method. public static void main(String[] args) { initializeShipList(); // initial ships
  • 11. initializeCruiseList(); // initial cruises initializePassengerList(); // initial passengers // add loop and code here that accepts and validates user input // and takes the appropriate action. include appropriate // user feedback and redisplay the menu as needed 2. Main Method: Complete the code for the main() method. When your code is complete, test the output. Be sure that the completed method does the following: a. Includes a loop that allows the user to interact with the menu until they signal that they want to exit the system b. Maps user input to the specified functionality based on the all menu options listed below. A text version of this table is also available.
  • 12. Note: The methods for Edit Ship, Edit Cruise, and Edit Passenger do not need to be completed but should still be mapped. When you test your menu, if you enter 2, 4, or 6 for a menu selection, you should get a response that the “feature is not yet implemented.” 3. Industry Standard Best Practices: To ensure clarity, consistency, and efficiency among all software developers, your code must do the following: a. Ensure that all user input is validated with appropriate feedback to the user b. Follow appropriate naming conventions for variables and methods c. Include descriptive in-line comments for all code you create and modify Part Six: Submission Upon completing your code for each class file, review the What to Submit section of the Project Three overview and submit all files to the Project Three submission.
  • 13. https://learn.snhu.edu/d2l/lor/viewer/view.d2l?ou=6606&loIdent Id=24108 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. Comment by Gutschow, Molly: Jordan: Link to IT 145 System Menu Text Version. CruiseShipProject/.classpath
  • 15. org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.source=9 CruiseShipProject/bin/Cruise.classpublicsynchronizedclass Cruise { private String cruiseName; private String cruiseShipName; private String departurePort; private String destination; private String returnPort; void Cruise(); void Cruise(String, String, String, String, String); public String getCruiseName(); public String getCruiseShipName(); public String getDeparturePort(); public String getDestination(); public String getReturnPort(); public void setCruiseName(String); public void setCruiseShipName(String); public void setDeparturePort(String); public void setDestination(String); public void setReturnPort(String); public void printCruiseDetails(); public String toString(); } CruiseShipProject/bin/Driver.classpublicsynchronizedclass Driver { privatestatic java.util.ArrayList shipList; privatestatic java.util.ArrayList cruiseList;
  • 16. privatestatic java.util.ArrayList passengerList; static void <clinit>(); public void Driver(); publicstatic void main(String[]); publicstatic void initializeShipList(); publicstatic void initializeCruiseList(); publicstatic void initializePassengerList(); publicstatic void add(String, int, int, int, int, boolean); publicstatic void printShipList(String); publicstatic void printCruiseList(String); publicstatic void printPassengerList(); publicstatic void displayMenu(); publicstatic void addShip(); publicstatic void editShip(); publicstatic void addCruise(); publicstatic void editCruise(); publicstatic void addPassenger(); publicstatic void editPassenger(); publicstatic boolean isANumber(String); } CruiseShipProject/bin/Passenger.classpublicsynchronizedclass Passenger { private String passengerName; private String passengerCruise; private String passengerRoomType; void Passenger(); void Passenger(String, String, String); public String getPassengerName(); public String getPassengerCruise(); public String getPassengerRoomType(); public void setPassengerName(String); public void setPassengerCruise(String); public void setPassengerRoomType(String); public void printPassenger();
  • 17. public String toString(); } CruiseShipProject/bin/Ship.classpublicsynchronizedclass Ship { private String shipName; private int roomBalcony; private int roomOceanView; private int roomSuite; private int roomInterior; private boolean inService; void Ship(); void Ship(String, int, int, int, int, boolean); public String getShipName(); public int getRoomBalcony(); public int getRoomOceanView(); public int getRoomSuite(); public int getRoomInterior(); public boolean getInService(); public void setShipName(String); public void setRoomBalcony(int); public void setRoomOceanView(int); public void setRoomSuite(int); public void setRoomInterior(int); public void setInService(boolean); public void printShipData(); public String toString(); } CruiseShipProject/src/Cruise.javaCruiseShipProject/src/Cruise.j avapublicclassCruise{ // Class Variables privateString cruiseName; privateString cruiseShipName;
  • 18. privateString departurePort; privateString destination; privateString returnPort; // Constructor - default Cruise(){ } // Constructor - full Cruise(String tCruiseName,String tShipName,String tDeparture, String tDestination,String tReturn){ cruiseName = tCruiseName; cruiseShipName = tShipName; departurePort = tDeparture; destination = tDestination; returnPort = tReturn; } // Accessors publicString getCruiseName(){ return cruiseName; } publicString getCruiseShipName(){ return cruiseShipName; } publicString getDeparturePort(){ return departurePort; } publicString getDestination(){ return destination; } publicString getReturnPort(){
  • 19. return returnPort; } // Mutators publicvoid setCruiseName(String tVar){ cruiseName = tVar; } publicvoid setCruiseShipName(String tVar){ cruiseShipName = tVar; } publicvoid setDeparturePort(String tVar){ departurePort = tVar; } publicvoid setDestination(String tVar){ destination = tVar; } publicvoid setReturnPort(String tVar){ returnPort = tVar; } // print cruise details publicvoid printCruiseDetails(){ // complete this method } // method added to print ship's name vice memory address @Override publicString toString(){ return cruiseName; }
  • 20. } CruiseShipProject/src/Driver.javaCruiseShipProject/src/Driver.j avaimport java.util.ArrayList; import java.util.Scanner; importstatic java.lang.Integer.parseInt; publicclassDriver{ // class variables (add more as needed) privatestaticArrayList<Ship> shipList =newArrayList(); privatestaticArrayList<Cruise> cruiseList =newArrayList(); privatestaticArrayList<Passenger> passengerList =newArrayList (); publicstaticvoid main(String[] args){ initializeShipList();// initial ships initializeCruiseList();// initial cruises initializePassengerList();// initial passengers // add loop and code here that accepts and validates user input // and takes the appropriate action. include appropriate // user feedback and redisplay the menu as needed } // hardcoded ship data for testing // Initialize ship list publicstaticvoid initializeShipList(){ add("Candy Cane",20,40,10,60,true); add("Peppermint Stick",10,20,5,40,true);
  • 21. add("Bon Bon",12,18,2,24,false); add("Candy Corn",12,18,2,24,false); } // hardcoded cruise data for testing // Initialize cruise list publicstaticvoid initializeCruiseList(){ Cruise newCruise =newCruise("Southern Swirl","Candy Cane"," Miami","Cuba","Miami"); cruiseList.add(newCruise); } // hardcoded cruise data for testing // Initialize passenger list publicstaticvoid initializePassengerList(){ Passenger newPassenger1 =newPassenger("Neo Anderson","Sou thern Swirl","STE"); passengerList.add(newPassenger1); Passenger newPassenger2 =newPassenger("Trinity","Southern S wirl","STE"); passengerList.add(newPassenger2); Passenger newPassenger3 =newPassenger("Morpheus","Souther n Swirl","BAL"); passengerList.add(newPassenger3); } // custom method to add ships to the shipList ArrayList publicstaticvoid add(String tName,int tBalcony,int tOceanView, int tSuite,int tInterior,boolean tInService){ Ship newShip =newShip(tName, tBalcony, tOceanView, tSuite, tInterior, tInService); shipList.add(newShip); }
  • 22. publicstaticvoid printShipList(String listType){ // 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("nThere are no ships to print."); return; } if(listType =="name"){ System.out.println("nnSHIP LIST - Name"); for(int i =0; i < shipList.size(); i++){ System.out.println(shipList.get(i)); } }elseif(listType =="active"){ System.out.println("nnSHIP LIST - Active"); // complete this code block }elseif(listType =="full"){ System.out.println("nnSHIP LIST - Full"); System.out.println("-----------------------------------------------"); System.out.println(" Number of Rooms In"); System.out.print("SHIP NAME Bal OV Ste Int Servic e"); System.out.println("n----------------------------------------------- "); for(Ship eachShip: shipList) eachShip.printShipData(); }else
  • 23. System.out.println("nnError: List type not defined."); } publicstaticvoid printCruiseList(String listType){ if(cruiseList.size()<1){ System.out.println("nThere are no cruises to print."); return; } if(listType =="list"){ System.out.println("nnCRUISE LIST"); for(int i=0; i < cruiseList.size(); i++){ System.out.println(cruiseList.get(i)); } }elseif(listType =="details"){ System.out.println("nnCRUISE LIST - Details"); System.out.println("--------------------------------------------------- ---------------------------------------"); System.out.println(" |-------------------- --PORTS-----------------------|"); System.out.print("CRUISE NAME SHIP NAME DE PARTURE DESTINATION RETURN"); System.out.println("n------------------------------------------------- ----------------------------------------"); for(Cruise eachCruise: cruiseList) eachCruise.printCruiseDetails(); }else System.out.println("nnError: List type not defined."); } publicstaticvoid printPassengerList(){ if(passengerList.size()<1){ System.out.println("nThere are no passengers to print."); return; } System.out.println("nnPASSENGER LIST"); System.out.println("---------------------------------------------------
  • 24. --"); System.out.print("PASSENGER NAME CRUISE R OOM TYPE"); System.out.println("n------------------------------------------------- ----"); for(Passenger eachPassenger: passengerList) eachPassenger.printPassenger(); } // display text-based menu publicstaticvoid displayMenu(){ System.out.println("nn"); System.out.println("tttLuxury Ocean Cruise Outings"); System.out.println("tttttSystem Menun"); System.out.println("[1] Add Ship [A] Print Ship Names" ); System.out.println("[2] Edit Ship [B] Print Ship In Servic e List"); System.out.println("[3] Add Cruise [C] Print Ship Full Li st"); System.out.println("[4] Edit Cruise [D] Print Cruise List") ; System.out.println("[5] Add Passenger [E] Print Cruise Deta ils"); System.out.println("[6] Edit Passenger [F] Print Passenger L ist"); System.out.println("[x] Exit System"); System.out.println("nEnter a menu selection: "); } // Add a New Ship publicstaticvoid addShip(){ // complete this method
  • 25. } // Edit an existing ship publicstaticvoid editShip(){ // This method does not need to be completed System.out.println("The "Edit Ship" feature is not yet impleme nted."); } // Add a New Cruise publicstaticvoid addCruise(){ // complete this method } // Edit an existing cruise publicstaticvoid editCruise(){ // This method does not need to be completed System.out.println("The "Edit Cruise" feature is not yet imple mented."); } // Add a New Passenger publicstaticvoid addPassenger(){ Scanner newPassengerInput =newScanner(System.in); System.out.println("Enter the new passenger's name: "); String newPassengerName = newPassengerInput.nextLine(); // ensure new passenger name does not already exist
  • 26. for(Passenger eachPassenger: passengerList){ if(eachPassenger.getPassengerName().equalsIgnoreCase(newPas sengerName)){ System.out.println("That passenger is already in the system. Exi ting to menu..."); return;// quits addPassenger() method processing } } // get cruise name for passenger System.out.println("Enter cruise name: "); String newCruiseName = newPassengerInput.nextLine(); // ensure cruise exists for(Cruise eachCruise: cruiseList){ if(eachCruise.getCruiseName().equalsIgnoreCase(newCruiseNa me)){ // cruise does exist }else{ System.out.println("That cruise does not exist in the system. Ex iting to menu..."); return;// quits addPassenger() method processing } } // get room type System.out.println("Enter Room Type (BAL, OV, STE, or INT: "); String room = newPassengerInput.nextLine(); // validate room type if((room.equalsIgnoreCase("BAL"))||(room.equalsIgnoreCase(" OV"))|| (room.equalsIgnoreCase("STE"))||(room.equalsIgnoreCase("INT "))){ // validation passed - add passenger Passenger newPassenger =newPassenger(newPassengerName, ne
  • 27. wCruiseName, room.toUpperCase()); passengerList.add(newPassenger); }else{ System.out.println("Invalid input. Exiting to menu..."); return;// quits addPassenger() method processing } } // Edit an existing passenger publicstaticvoid editPassenger(){ // This method does not need to be completed System.out.println("The "Edit Passenger" feature is not yet im plemented."); } // Method to check if input is a number publicstaticboolean isANumber(String str){ for(int i =0; i < str.length(); i++){ if(Character.isDigit(str.charAt(i))==false) returnfalse; } returntrue; } } CruiseShipProject/src/Passenger.javaCruiseShipProject/src/Pass enger.javapublicclassPassenger{ // Class variables privateString passengerName; privateString passengerCruise; privateString passengerRoomType;
  • 28. // Constructor - default Passenger(){ } // Constructor - full Passenger(String pName,String pCruise,String pRoomType){ passengerName = pName; passengerCruise = pCruise; passengerRoomType = pRoomType;// should be BAL, OV, STE, or INT } // Accessors publicString getPassengerName(){ return passengerName; } publicString getPassengerCruise(){ return passengerCruise; } publicString getPassengerRoomType(){ return passengerRoomType; } // Mutators publicvoid setPassengerName(String tVar){ passengerName = tVar; } publicvoid setPassengerCruise(String tVar){ passengerCruise = tVar; }
  • 29. publicvoid setPassengerRoomType(String tVar){ passengerRoomType = tVar; } // print method publicvoid printPassenger(){ int spaceCount; String spaces1 =""; String spaces2 =""; spaceCount =20- passengerName.length(); for(int i =1; i <= spaceCount; i++){ spaces1 = spaces1 +" "; } spaceCount =20- passengerCruise.length(); for(int i =1; i <= spaceCount; i++){ spaces2 = spaces2 +" "; } System.out.println(passengerName + spaces1 + passengerCruise + spaces2 + passengerRoomType); } // method added to print passenger's name vice memory address @Override publicString toString(){ return passengerName; } } CruiseShipProject/src/Ship.javaCruiseShipProject/src/Ship.java publicclassShip{ // Class Variables
  • 30. privateString shipName; privateint roomBalcony; privateint roomOceanView; privateint roomSuite; privateint roomInterior; privateboolean inService; // Constructor - default Ship(){ } // Constructor - full Ship(String tName,int tBalcony,int tOceanView, int tSuite,int tInterior,boolean tInService){ shipName = tName; roomBalcony = tBalcony; roomOceanView = tOceanView; roomSuite = tSuite; roomInterior = tInterior; inService = tInService; } // Accessors publicString getShipName(){ return shipName; } publicint getRoomBalcony(){ return roomBalcony; } publicint getRoomOceanView(){ return roomOceanView; } publicint getRoomSuite(){
  • 31. return roomSuite; } publicint getRoomInterior(){ return roomInterior; } publicboolean getInService(){ return inService; } // Mutators publicvoid setShipName(String tVar){ shipName = tVar; } publicvoid setRoomBalcony(int tVar){ roomBalcony = tVar; } publicvoid setRoomOceanView(int tVar){ roomOceanView = tVar; } publicvoid setRoomSuite(int tVar){ roomSuite = tVar; } publicvoid setRoomInterior(int tVar){ roomInterior = tVar; } publicvoid setInService(boolean tVar){ inService = tVar; }
  • 32. // print method publicvoid printShipData(){ int spaceCount; String spaces =""; spaceCount =20- shipName.length(); for(int i =1; i <= spaceCount; i++){ spaces = spaces +" "; } System.out.println(shipName + spaces + roomBalcony +"t"+ roomOceanView +"t"+ roomSuite +"t"+ roomInterior +"tt"+ inService); } // method added to print ship's name vice memory address @Override publicString toString(){ return shipName; } } Project Three Guidelines and Rubric Competency In this project, you will demonstrate your mastery of the following competency:
  • 33. • Write programs using object-oriented conventions in accordance with industry standard best practices Scenario You work for Global Rain, a software engineering company that specializes in custom software design and development. As a junior software developer, you are part of a software development team at Global Rain that collaborates to create software solutions for entrepreneurs, businesses and government agencies around the world. Your Global Rain software development team has been asked to develop a menu-driven system for the Luxury Ocean Cruise Outings company. This company coordinates cruise bookings for luxury ship owners and cruise lines. As a returning customer for Global Rain, Luxury Ocean Cruise Outings has
  • 34. requested a simple menu-based system to perform core functions that are IT-145-T1604 Found in App Develo… RL Reflect in ePortfolio Download Print Open with docReader Activity Details You have viewed this topic Last Visited Oct 10, 2019 8:21 PM