staticScannerinput=newScanner(System.in);// global scanner
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;
staticStringseat;
...
@@ -27,8 +27,10 @@ public class airline {
...
@@ -27,8 +27,10 @@ public class airline {
publicstaticvoiddetails(){
publicstaticvoiddetails(){
System.out.print("What is your name? ");
System.out.print("What is your first name? ");
name=input.next();
fname=input.next();
System.out.print("What is your surname? ");
sname=input.next();
System.out.print("Where will you be flying from? ");
System.out.print("Where will you be flying from? ");
ocity=input.next();
ocity=input.next();
System.out.print("Where are you flying to? ");
System.out.print("Where are you flying to? ");
...
@@ -182,7 +184,7 @@ public class airline {
...
@@ -182,7 +184,7 @@ public class airline {
Stringnoseat=input.next();
Stringnoseat=input.next();
switch(noseat){
switch(noseat){
case"n":
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;
return;
case"y":
case"y":
Class();//takes them back to the class selection
Class();//takes them back to the class selection
...
@@ -299,7 +301,7 @@ public class airline {
...
@@ -299,7 +301,7 @@ public class airline {
System.out.println("This is your boarding pass:");
System.out.println("This is your boarding pass:");