Commit c44069e2 authored by User's avatar User

comments

parent 2493412b
......@@ -15,23 +15,23 @@ 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-"
while(true) {//loop to repeat code
System.out.print("Choose a flight Class-"//print out options to the user
+ "\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");
switch(choice = input.nextInt()) {//switch case to run different outcomes
case 1://case if user chooses first class/1
System.out.println("You have Chosen First Class");//prints out the class that the user has chosen
break;
case 2:
System.out.println("You have Chosen Business Class");
case 2://case if user chooses business class/2
System.out.println("You have Chosen Business Class");//prints out the class that the user has chosen
break;
case 3:
System.out.println("You have Chosen Economy Class");
case 3://case if user chooses economy class/3
System.out.println("You have Chosen Economy Class");//prints out the class that the user has chosen
break;
default:
System.out.println("Invalid option. Please choose a number from 1 to 3\n------------");
default://case if user chooses an invalid option
System.out.println("Invalid option. Please choose a number from 1 to 3\n------------");//prints out an error message
break;
}
}
......
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