Question: How do I get it so that when the user answers N to a buisness ticket it will accept the prompt the 1 st time?

How do I get it so that when the user answers N to a buisness ticket it will accept the prompt the 1st time?
Heres the code:
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();
}
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!