FlightReservations

FlightReservations - public class FlightReservations cfw_...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
public class FlightReservations { public static void main(String[] args) { final String noPassenger = "no passenger"; System.out.print("Enter the number of rows on the plane: "); int numRows = IO.readInt(); if (numRows < 1) { System.out.println("There must be at least one row of seats on the plane."); IO.reportBadInput(); return; } System.out.print("Enter the number of seats in each row: "); int seatsPerRow = IO.readInt(); if (seatsPerRow < 1) { System.out.println("There must be at least one seat in each row."); IO.reportBadInput(); return; } int aisle = (seatsPerRow)/2; String[][] passenger = new String[numRows][seatsPerRow]; while (true) { System.out.println(); System.out.println("Menu:"); System.out.println("1. Assign passenger to a specific seat"); System.out.println("2. Reserve (search for) one seat"); System.out.println("3. Get name of passenger as signed to a specific seat"); System.out.println("4. Get seat assignment for a passenger"); System.out.println("5. Cancel a reservation"); System.out.println("6. Quit"); System.out.println(); System.out.print("Enter your choice (1-6): ");
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/03/2009 for the course CS 01-111 taught by Professor Pradiphari during the Fall '09 term at Rutgers.

Page1 / 5

FlightReservations - public class FlightReservations cfw_...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online