Commit 2493412b authored by User's avatar User

menu

parent f50fe387
......@@ -4,6 +4,7 @@ public class reservation {
public static void main(String[] args) {//main subprogram
Scanner input = new Scanner(System.in);
int choice = 0;
String plane[][] = {{"01", "02", "03"}, {"04", "05", "06"}, {"07", "08", "09"}, //initialise the array which contains the plane seats
{"10", "11", "12"}, {"13", "14", "15"}, {"16", "17", "18"},
{"19", "20", "21"}, {"22", "23", "24"}, {"25", "26", "27"},
......@@ -14,6 +15,27 @@ public class reservation {
{"64", "65", "66"}, {"67", "68", "69"}, {"70", "71", "72"},
{"73", "74", "75"}, {"76", "77", "78"}, {"79", "80", "81"},
{"82", "83", "84"}, {"85", "86", "87"}, {"88", "89", "90"}};
while(true) {
System.out.print("Choose a flight Class-"
+ "\nPlease Type 1 for First Class"
+ "\nPlease Type 2 for Business"
+ "\nPlease Type 3 for Economy \n");
switch(choice = input.nextInt()) {
case 1:
System.out.println("You have Chosen First Class");
break;
case 2:
System.out.println("You have Chosen Business Class");
break;
case 3:
System.out.println("You have Chosen Economy Class");
break;
default:
System.out.println("Invalid option. Please choose a number from 1 to 3\n------------");
break;
}
}
}
public static void display(String plane[][]) {//create method called "display"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment