System.out.print(" Enter the origin airport: \n ");
origin=input.next();
System.out.print(" Enter the destination airport: \n ");
...
...
@@ -52,32 +54,23 @@ public class ar1 {
System.out.print(" Enter the reservation name: \n ");
name=input.next();
}
else{
//testing
}
//variable reset 2
for(intx=0;x<94;x++){
flights[x][28][0]="END";//needmore
flights[x][28][0]="END";
}
//test dump
/*for(int x = 0; x < 94; x++) {
for(int y = 0; y < 29; y++) {
System.out.print(flights [x] [y] + " ");
}
System.out.println("");
}*/
//flight number calculator
//flight number selector / generator
for(inty=0;y<29;y++){
if(flights[1][y][0].equals(origin)){
if(flights[2][y][0].equals(destination)){
if(flights[2][y][0].equals(destination)){//if these match, load flight data
if(flights[3][y][0].equals(departtime)){
mode=1;
y=28;
y=28;//force stops the for loop
}
else{
mode=2;
...
...
@@ -89,21 +82,22 @@ public class ar1 {
}
elseif(flights[1][y][0].equals("E")){
flightnumber=y;
mode=1;
mode=1;//if there is an empty flight as the next available
y=28;
}
elseif(flights[1][y][0].equals("END")){
System.out.println("there are no more flights avalible today");
yarr=1;
yarr=1;//if there are no flights, end the program
ordertickets=0;
}
else{
mode=2;
}
//mode = 1;
//flightnumber = 1;
}
//flight number iterator
if(mode==2){
flightnumber=flightnumber+1;
if(flightnumber<10){
...
...
@@ -125,15 +119,8 @@ public class ar1 {
System.out.print("");
}
//FL = "00";
//flightnumber = 0;
//book seats top display text
/*//temporary fix for the flight number code
System.out.print(" Enter the flight number: \n ");
flightnumber = input.nextInt();
FL = flightnumber + "";*/
//book seats
if(yarr==0){
System.out.println(" ------------------------------------- \n Type in the seat number you want to have \n '[XX]' means that the seat is taken \n after selecting a seat, the boarding pass will be generated \n -------------------------------------");