Commit 2b5043d2 authored by LoomyGames's avatar LoomyGames

Fixed some stuff, still not complete

parent f85e03bc
import java.util.Scanner;
public class Yeyey1 {
static Scanner input = new Scanner(System.in); //We're just setting up the input for now;
static String[] seat = new String[100];
static int j=0,k=0,mainSeatNumber=0,classRead;
static String personName;
static String destination;
static String currentCity;
static String[] planeName = new String[28];
static int bookAgain = 1;
public static void main(String[] args) {
// TODO Auto-generated method stub
for(int i = 0;i<90;i++)
{
seat[i] = String.valueOf(i+1);
......@@ -18,12 +20,21 @@ public class Yeyey1 {
{
seat[i] = "0" + String.valueOf(i+1);
}
}
ShowSeats();
for(int i = 0; i<28; i++)
{
if(i<9)
{
planeName[i] = "FL0" + (i + 1);
}
else
planeName[i] = "FL" + (i + 1);
}
GiveInfo();
while(classRead!=4)
while(bookAgain == 1)
{
System.out.println("For First Class please input 1");
......@@ -32,8 +43,13 @@ public class Yeyey1 {
classRead = input.nextInt();
BookSeats(classRead);
System.out.println("Would you like to book another seat? 0 = no / 1 = yes");
bookAgain = input.nextInt();
}
ShowSeats();
if(bookAgain == 0)
{
System.out.println("Have a good day!");
}
}
......@@ -117,10 +133,32 @@ public class Yeyey1 {
public static void OccupySeats()
{
mainSeatNumber = input.nextInt();
if(seat[mainSeatNumber] !="XX")
if(seat[mainSeatNumber - 1] !="XX")
{
seat[mainSeatNumber - 1] = "XX";
ShowSeats();
}
else
{
seat[mainSeatNumber - 1] = "XX";
}else System.out.println("Seat is already occupied");
System.out.println("Seat is already occupied");
System.out.println("Would you like to book another seat? 0 = no / 1 = yes-------");
bookAgain = input.nextInt();
ShowSeats();
}
}
public static void GiveInfo()
{
System.out.println("Welcome to our online booking system");
System.out.print("Please enter your name: ");
personName = input.nextLine();
System.out.print("Please enter your city: ");
currentCity = input.next();
System.out.print("Please enter your destination: ");
destination = input.next();
ShowSeats();
}
}
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