staticScannerinput=newScanner(System.in);// global scanner
staticStringname;staticStringocity;staticStringdcity;//assigning global variables for customer details
staticStringfname;staticStringsname;staticStringocity;staticStringdcity;//assigning global variables for customer details
staticStringseat;
...
...
@@ -27,8 +27,10 @@ public class airline {
publicstaticvoiddetails(){
System.out.print("What is your name? ");
name=input.next();
System.out.print("What is your first name? ");
fname=input.next();
System.out.print("What is your surname? ");
sname=input.next();
System.out.print("Where will you be flying from? ");
ocity=input.next();
System.out.print("Where are you flying to? ");
...
...
@@ -182,7 +184,7 @@ public class airline {
Stringnoseat=input.next();
switch(noseat){
case"n":
System.out.println("We are afraid we cannot accomodate you. The next flight to "+dcity+" is in 6 hours");//ends the program for them to restart for the next flight
System.out.println("Sorry there is no available seat at the moment. Next flight leaves in 6 hours");//ends the program for them to restart for the next flight
return;
case"y":
Class();//takes them back to the class selection
...
...
@@ -299,7 +301,7 @@ public class airline {
System.out.println("This is your boarding pass:");