daily pastebin goal
38%
SHARE
TWEET

Untitled

a guest Feb 21st, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. else if (option == 'D') {
  2.             System.out.println("Enter delay time in hours (e.g. 1.5): ");
  3.             double delay = input.nextDouble();
  4.             input.nextLine();
  5.             double hours = (int) delay;
  6.             double minutes = (delay - hours) * 60;
  7.  
  8.             if (flights[index].delayFlight((int) hours, (int) minutes)) {
  9.                 System.out.println("\nFlight Number "
  10.                         + flights[index].getFlightNumber()
  11.                         + " was successfully delayed");
  12.                 System.out.println("New departure time is: "
  13.                         + flights[index].getDepartureTime());
  14.             } else {
  15.                 if (flights[index].getStatus() == 'B')
  16.                    System.out.println("Error: delay invalid, flight is boarding.");
  17.                 if (flights[index].getStatus() == 'D')
  18.                    System.out.println("Error: delay invalid, flight has departed.");
  19.              else
  20.                    System.out.println("flight number " + flights[index].getFlightNumber()
  21.                          + " has been cancelled due to delays");
  22.            
  23.             }
  24.            
  25.             // Reserve seats on flights
  26.         } else if (option == 'R') {
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top