Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

package com.cc . airline.utilities; import java.util.ArrayList; import com.cc . airline.ticketing.Seat; import com.cc . airline.ticketing.SeatingClass; import com.cc . airline.ticketing.SeatingPlan; public class Manifest { SeatingPlan plan; public

package com.cc.airline.utilities;
import java.util.ArrayList;
import com.cc.airline.ticketing.Seat;
import com.cc.airline.ticketing.SeatingClass;
import com.cc.airline.ticketing.SeatingPlan;
public class Manifest {
SeatingPlan plan;
public Manifest(SeatingPlan plan){
this.plan = plan;
}
private void printOut(){
ArrayList seats = plan.getSeats();
System.out.println("Flight manifest");
for (Seat s: seats){
System.out.println(s);
}
}
public static void main(String[] args){
System.out.println("Flight open for ticket sales.");
SeatingPlan plan = new SeatingPlan();
Manifest manifest = new Manifest(plan);
SeatReserver reserver = plan.getSeatReserver();
int seatsSold =0;
UserPrompter prompter = new UserPrompter("Do you want to purchace a ticket?");
while ( prompter.getYesNoAnswer() && seatsSold < plan.getTotalSeats()){
for ( int c =0; c < SeatingClass.values().length; c++){
SeatingClass sClass = SeatingClass.values()[c];
if ( sClass.getNumSeatsSold()< sClass.getNumSeats()){
UserPrompter prompt2= new UserPrompter(" Do you want "+ sClass +" class? ");
if ( prompt2.getYesNoAnswer()){
reserver.sellTicket(sClass);
break;
}
}
}
}
manifest.printOut();
}
} List three defects that you located in the original code, and describe then as you would in a testers
defect report. Describe where user is in using the system and what the user input. Then state how
the system response deviated from expected output. (6).
a. Where:
User input:
System response:
b. Where:
User input:
System response:
c. Where:
User input:
System response:
SeatingPlan plan = new SeatingPlan();
Manifest manifest = new Manifest(plan);
SeatReserver reserver = plan.getSeatReserver();
int seatsSold =0;
UserPrompter prompter = new UserPrompter("Do you want to purchace a ticket?");
while ( prompter.getYesNoAnswer() && seatsSold < plan.getTotalSeats()){
for ( int c =0; c < SeatingClass.values().length; c++){
SeatingClass sClass = SeatingClass.values()[c];
if ( sClass.getNumSeatsSold()< sClass.getNumSeats()){
UserPrompter prompt2= new UserPrompter(" Do you want "+ sClass +" class? ");
if ( prompt2.getYesNoAnswer()){
reserver.sellTicket(sClass);
break;
}
}
}
}
manifest.printOut();
}
}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems 22nd European Conference Adbis 2018 Budapest Hungary September 2 5 2018 Proceedings Lncs 11019

Authors: Andras Benczur ,Bernhard Thalheim ,Tomas Horvath

1st Edition

3319983970, 978-3319983974

More Books

Students also viewed these Databases questions

Question

2. Describe how technology can impact intercultural interaction.

Answered: 1 week ago

Question

7. Define cultural space.

Answered: 1 week ago