Commit b45ab046 authored by charlie.hamer's avatar charlie.hamer

Changing error messages and adding surname

parent 15a83ec5
......@@ -14,7 +14,7 @@ public class airline {
static Scanner input = new Scanner(System.in); // global scanner
static String name; static String ocity; static String dcity; //assigning global variables for customer details
static String fname; static String sname; static String ocity; static String dcity; //assigning global variables for customer details
static String seat;
......@@ -27,8 +27,10 @@ public class airline {
public static void details() {
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 {
String noseat = 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:");
System.out.println("");
System.out.println("|[ BOARDING PASS ]|");
System.out.println("Name : " + name);
System.out.println("Name : " + fname + " " +sname);
System.out.println("From : " + ocity);
System.out.println("To : " + dcity);
System.out.println("Flight : FL" + flight[select]);
......
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