Sen

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 22

package Mumbai;

import java.lang.*;

import java.util.Scanner;

public class Mumbai

public void mum()

String name,email;

int age,count,time;

String date,departure,destination;

String travel_class;

int bus_class=120,eco_class=180;

Scanner sc=new Scanner(System.in);

System.out.println("Enter destination among below:\nDelhi\nBanglore\nNagpur");

destination=sc.next();

switch(destination)

case "Nagpur":

System.out.println(" departure time | arrival time | Flight ");

System.out.println("------------------------------------------------------------------");

System.out.println("1) 16:25 | 18:05 | Indigo ");

System.out.println("2) 05:05 | 06:45 | Vistara ");

System.out.println("3) 21:15 | 22:55 | AirAsia ");

System.out.println("4) 07:10 | 08:40 | AirIndia ");

System.out.println("Kindly enter the suitable timing: ");

time=sc.nextInt();

switch(time)

case 1:

System.out.println();
System.out.println("Dear customer the vacant seats for this flight are 30, among which \n18 seats
are of economic class and 12 are of business class\nKindly choose your seat so that we can confirm
the booking ");

break;

case 2:

System.out.println();

System.out.println("Dear customer the vacant seats for this flight are 40, among which \n15 seats
are of economic class and 25 are of business class\nKindly choose your seat so that we can confirm
the booking ");

break;

case 3:

System.out.println();

System.out.println("Dear customer the vacant seats for this flight are 12, among which \n8 seats are
of economic class and 4 are of business class\nKindly choose your seat so that we can confirm the
booking ");

break;

case 4:

System.out.println();

System.out.println("Dear customer the vacant seats for this flight are 30, among which \n18 seats
are of economic class and 12 are of business class\nKindly choose your seat so that we can confirm
the booking ");

break;

break;

case "Delhi":

System.out.println(" departure time | arrival time | Flight ");

System.out.println("------------------------------------------------------------------");

System.out.println("1) 01:50 | 04:00 | Indigo ");

System.out.println("2) 02:25 | 06:30 | Vistara ");

System.out.println("3) 07:00 | 09:15 | AirIndia ");

System.out.println("4) 04:15 | 08:25 | AirAsia ");

System.out.println("Kindly enter the suitable timing: ");


time=sc.nextInt();

switch(time)

case 1:

System.out.println();

System.out.println("Dear customer the vacant seats for this flight are 30, among which \n18 seats
are of economic class and 12 are of business class\nKindly choose your seat so that we can confirm
the booking ");

break;

case 2:

System.out.println();

System.out.println("Dear customer the vacant seats for this flight are 40, among which \n15 seats
are of economic class and 25 are of business class\nKindly choose your seat so that we can confirm
the booking ");

break;

case 3:

System.out.println();

System.out.println("Dear customer the vacant seats for this flight are 12, among which \n8 seats are
of economic class and 4 are of business class\nKindly choose your seat so that we can confirm the
booking ");

break;

case 4:

System.out.println();

System.out.println("Dear customer the vacant seats for this flight are 30, among which \n18 seats
are of economic class and 12 are of business class\nKindly choose your seat so that we can confirm
the booking ");

break;

break;

case "Banglore":

System.out.println(" departure time | arrival time | Flight ");

System.out.println("------------------------------------------------------------------");
System.out.println("1) 10:05 | 14:35 | Indigo ");

System.out.println("2) 00:25 | 02:20 | Akasa Air ");

System.out.println("3) 00:35 | 02:55 | Indigo ");

System.out.println("4) 00:25 | 02:20 | Vistara ");

System.out.println("Kindly enter the suitable timing: ");

time=sc.nextInt();

switch(time)

case 1:

System.out.println();

System.out.println("Dear customer the vacant seats for this flight are 30, among which \n18 seats
are of economic class and 12 are of business class\nKindly choose your seat so that we can confirm
the booking ");

break;

case 2:

System.out.println();

System.out.println("Dear customer the vacant seats for this flight are 40, among which \n15 seats
are of economic class and 25 are of business class\nKindly choose your seat so that we can confirm
the booking ");

break;

case 3:

System.out.println();

System.out.println("Dear customer the vacant seats for this flight are 12, among which \n8 seats are
of economic class and 4 are of business class\nKindly choose your seat so that we can confirm the
booking ");

break;

case 4:

System.out.println();

System.out.println("Dear customer the vacant seats for this flight are 30, among which \n18 seats
are of economic class and 12 are of business class\nKindly choose your seat so that we can confirm
the booking ");

break;

}
default:

System.out.println("Sorry... We don't have flight for these places");

break;

//package Nagpur

package Nagpur;

import java.lang.*;

import java.util.*;

public class Nagpur

public void nag()

String name,email;

int age,count,time;

String date,departure,destination;

String travel_class;

int bus_class=120,eco_class=180;

Scanner sc=new Scanner(System.in);

System.out.println("Enter destination among below: \nMumbai\nDelhi\nBanglore ");

destination=sc.next();

switch(destination)

case "Delhi":

System.out.println(" departure time | arrival time | Flight ");

System.out.println("------------------------------------------------------------------");

System.out.println("1) 20:20 | 22:00 | Indigo ");

System.out.println("2) 23:20 | 01:10 | Indigo ");

System.out.println("3) 06:55 | 08:45 | Vistara ");


System.out.println("4) 08:55 | 10:45 | AirIndia ");

System.out.println("Kindly enter the suitable timing: ");

time=sc.nextInt();

switch(time)

case 1:

System.out.println();

System.out.println("Dear customer the vacant seats for this flight are 30, among which \n18 seats
are of economic class and 12 are of business class\nKindly choose your seat so that we can confirm
the booking ");

break;

case 2:

System.out.println();

System.out.println("Dear customer the vacant seats for this flight are 40, among which \n15 seats
are of economic class and 25 are of business class\nKindly choose your seat so that we can confirm
the booking ");

break;

case 3:

System.out.println();

System.out.println("Dear customer the vacant seats for this flight are 12, among which \n8 seats are
of economic class and 4 are of business class\nKindly choose your seat so that we can confirm the
booking ");

break;

case 4:

System.out.println();

System.out.println("Dear customer the vacant seats for this flight are 30, among which \n18 seats
are of economic class and 12 are of business class\nKindly choose your seat so that we can confirm
the booking ");

break;

case "Banglore":

{
System.out.println(" departure time | arrival time | Flight ");

System.out.println("------------------------------------------------------------------");

System.out.println("1) 22:00 | 23:50 | Indigo ");

System.out.println("2) 19:00 | 20:35 | Vistara ");

System.out.println("3) 17:20 | 21:50 | AirIndia ");

System.out.println("4) 21:00 | 22:50 | Indigo ");

System.out.println("Kindly enter the suitable timing: ");

time=sc.nextInt();

switch(time)

case 1:

System.out.println();

System.out.println("Dear customer the vacant seats for this flight are 30, among which \n18 seats
are of economic class and 12 are of business class\nKindly choose your seat so that we can confirm
the booking ");

break;

case 2:

System.out.println();

System.out.println("Dear customer the vacant seats for this flight are 40, among which \n15 seats
are of economic class and 25 are of business class\nKindly choose your seat so that we can confirm
the booking ");

break;

case 3:

System.out.println();

System.out.println("Dear customer the vacant seats for this flight are 12, among which \n8 seats are
of economic class and 4 are of business class\nKindly choose your seat so that we can confirm the
booking ");

break;

case 4:

System.out.println();

System.out.println("Dear customer the vacant seats for this flight are 30, among which \n18 seats
are of economic class and 12 are of business class\nKindly choose your seat so that we can confirm
the booking ");

break;
}

break;

case "Mumbai":

System.out.println(" departure time | arrival time | Flight ");

System.out.println("------------------------------------------------------------------");

System.out.println("1) 11:00 | 19:55 | express ");

System.out.println("2) 13:35 | 04:30 | AirAsia ");

System.out.println("3) 12:30 | 14:40 | Indigo ");

System.out.println("4) 16:15 | 18:20 | AirAsia ");

System.out.println("Kindly enter the suitable timing: ");

time=sc.nextInt();

switch(time)

case 1:

System.out.println();

System.out.println("Dear customer the vacant seats for this flight are 30, among which \n18 seats
are of economic class and 12 are of business class\nKindly choose your seat so that we can confirm
the booking ");

break;

case 2:

System.out.println();

System.out.println("Dear customer the vacant seats for this flight are 40, among which \n15 seats
are of economic class and 25 are of business class\nKindly choose your seat so that we can confirm
the booking ");

break;

case 3:

System.out.println();

System.out.println("Dear customer the vacant seats for this flight are 12, among which \n8 seats are
of economic class and 4 are of business class\nKindly choose your seat so that we can confirm the
booking ");

break;
case 4:

System.out.println();

System.out.println("Dear customer the vacant seats for this flight are 30, among which \n18 seats
are of economic class and 12 are of business class\nKindly choose your seat so that we can confirm
the booking ");

break;

break;

default:

System.out.println("Sorry... We don't have flight for these places");

break;

//package Banglore

package Bang;

import java.lang.*;

import java.util.*;

public class Banglore

public void Ban()

String name,email;

int age,count,time;

String date,departure,destination;

String travel_class;

int bus_class=120,eco_class=180;

Scanner sc=new Scanner(System.in);

System.out.println("Enter destination among below:\nMumbai\nDelhi\nNagpur ");

destination=sc.next();

switch(destination)
{

case "Nagpur":

System.out.println(" departure time | arrival time | Flight ");

System.out.println("------------------------------------------------------------------");

System.out.println("1) 05:25 | 07:00 | Indigo ");

System.out.println("2) 16:45 | 18:30 | Vistara ");

System.out.println("3) 20:50 | 01:45 | AirIndia ");

System.out.println("4) 03:00 | 07:30 | Emirates ");

System.out.println("Kindly enter the suitable timing: ");

time=sc.nextInt();

switch(time)

case 1:

System.out.println();

System.out.println("Dear customer the vacant seats for this flight are 30, among which \n18 seats
are of economic class and 12 are of business class\nKindly choose your seat so that we can confirm
the booking ");

break;

case 2:

System.out.println();

System.out.println("Dear customer the vacant seats for this flight are 40, among which \n15 seats
are of economic class and 25 are of business class\nKindly choose your seat so that we can confirm
the booking ");

break;

case 3:

System.out.println();

System.out.println("Dear customer the vacant seats for this flight are 12, among which \n8 seats are
of economic class and 4 are of business class\nKindly choose your seat so that we can confirm the
booking ");

break;

case 4:

System.out.println();
System.out.println("Dear customer the vacant seats for this flight are 30, among which \n18 seats
are of economic class and 12 are of business class\nKindly choose your seat so that we can confirm
the booking ");

break;

break;

case "Mumbai":

System.out.println(" departure time | arrival time | Flight ");

System.out.println("------------------------------------------------------------------");

System.out.println("1) 20:55 | 14:25 | Indigo ");

System.out.println("2) 06:00 | 07:45 | Akasa Air ");

System.out.println("3) 02:50 | 04:55 | AirIndia ");

System.out.println("4) 07:10 | 08:40 | Vistara ");

System.out.println("Kindly enter the suitable timing: ");

time=sc.nextInt();

switch(time)

case 1:

System.out.println();

System.out.println("Dear customer the vacant seats for this flight are 30, among which \n18 seats
are of economic class and 12 are of business class\nKindly choose your seat so that we can confirm
the booking ");

break;

case 2:

System.out.println();

System.out.println("Dear customer the vacant seats for this flight are 40, among which \n15 seats
are of economic class and 25 are of business class\nKindly choose your seat so that we can confirm
the booking ");

break;

case 3:
System.out.println();

System.out.println("Dear customer the vacant seats for this flight are 12, among which \n8 seats are
of economic class and 4 are of business class\nKindly choose your seat so that we can confirm the
booking ");

break;

case 4:

System.out.println();

System.out.println("Dear customer the vacant seats for this flight are 30, among which \n18 seats
are of economic class and 12 are of business class\nKindly choose your seat so that we can confirm
the booking ");

break;

break;

case "Delhi":

System.out.println(" departure time | arrival time | Flight ");

System.out.println("------------------------------------------------------------------");

System.out.println("1) 16:25 | 18:05 | Indigo ");

System.out.println("2) 05:05 | 06:45 | Spice Jet ");

System.out.println("3) 21:15 | 22:55 | Vistara ");

System.out.println("4) 06:15 | 08:10 | AirIndia ");

System.out.println("Kindly enter the suitable timing: ");

time=sc.nextInt();

switch(time)

case 1:

System.out.println();

System.out.println("Dear customer the vacant seats for this flight are 30, among which \n18 seats
are of economic class and 12 are of business class\nKindly choose your seat so that we can confirm
the booking ");

break;
case 2:

System.out.println();

System.out.println("Dear customer the vacant seats for this flight are 40, among which \n15 seats
are of economic class and 25 are of business class\nKindly choose your seat so that we can confirm
the booking ");

break;

case 3:

System.out.println();

System.out.println("Dear customer the vacant seats for this flight are 12, among which \n8 seats are
of economic class and 4 are of business class\nKindly choose your seat so that we can confirm the
booking ");

break;

case 4:

System.out.println();

System.out.println("Dear customer the vacant seats for this flight are 30, among which \n18 seats
are of economic class and 12 are of business class\nKindly choose your seat so that we can confirm
the booking ");

break;

break;

default:

System.out.println("Sorry... We don't have flight for these places");

break;

package Delhi;

import java.lang.*;

import java.util.*;

public class Delhi

public void d()


{

String name,email;

int age,count,time;

String date,departure,destination;

String travel_class;

int bus_class=120,eco_class=180;

Scanner sc=new Scanner(System.in);

System.out.println("Enter destination among below:\nMumbai\nNagpur\nBanglore ");

destination=sc.next();

switch(destination)

case "Banglore":

System.out.println(" departure time | arrival time | Flight ");

System.out.println("------------------------------------------------------------------");

System.out.println("1) 15:00 | 19:30 | Indigo ");

System.out.println("2) 00:10 | 03:05 | Vistara ");

System.out.println("3) 03:00 | 05:50 | AirIndia ");

System.out.println("4) 10:30 | 13:20 | Indigo ");

System.out.println("Kindly enter the suitable timing: ");

time=sc.nextInt();

switch(time)

case 1:

System.out.println();

System.out.println("Dear customer the vacant seats for this flight are 30, among which \n18 seats
are of economic class and 12 are of business class\nKindly choose your seat so that we can confirm
the booking ");

break;

case 2:

System.out.println();
System.out.println("Dear customer the vacant seats for this flight are 40, among which \n15 seats
are of economic class and 25 are of business class\nKindly choose your seat so that we can confirm
the booking ");

break;

case 3:

System.out.println();

System.out.println("Dear customer the vacant seats for this flight are 12, among which \n8 seats are
of economic class and 4 are of business class\nKindly choose your seat so that we can confirm the
booking ");

break;

case 4:

System.out.println();

System.out.println("Dear customer the vacant seats for this flight are 30, among which \n18 seats
are of economic class and 12 are of business class\nKindly choose your seat so that we can confirm
the booking ");

break;

case "Nagpur":

System.out.println(" departure time | arrival time | Flight ");

System.out.println("------------------------------------------------------------------");

System.out.println("1) 21:10 | 18:55 | Indigo ");

System.out.println("2) 20:20 | 07:30 | Vistara ");

System.out.println("3) 05:10 | 15:35 | AirIndia ");

System.out.println("4) 21:05 | 06:50 | Vistara ");

System.out.println("Kindly enter the suitable timing: ");

time=sc.nextInt();

switch(time)

case 1:

System.out.println();
System.out.println("Dear customer the vacant seats for this flight are 30, among which \n18 seats
are of economic class and 12 are of business class\nKindly choose your seat so that we can confirm
the booking ");

break;

case 2:

System.out.println();

System.out.println("Dear customer the vacant seats for this flight are 40, among which \n15 seats
are of economic class and 25 are of business class\nKindly choose your seat so that we can confirm
the booking ");

break;

case 3:

System.out.println();

System.out.println("Dear customer the vacant seats for this flight are 12, among which \n8 seats are
of economic class and 4 are of business class\nKindly choose your seat so that we can confirm the
booking ");

break;

case 4:

System.out.println();

System.out.println("Dear customer the vacant seats for this flight are 30, among which \n18 seats
are of economic class and 12 are of business class\nKindly choose your seat so that we can confirm
the booking ");

break;

break;

case "Mumbai":

System.out.println(" departure time | arrival time | Flight ");

System.out.println("------------------------------------------------------------------");

System.out.println("1) 13:55 | 16:10 | Express ");

System.out.println("2) 08:25 | 10:45 | AirAsia ");

System.out.println("3) 07:00 | 09:15 | Indigo ");

System.out.println("4) 22:55 | 01:10 | AirAsia ");

System.out.println("Kindly enter the suitable timing: ");


time=sc.nextInt();

switch(time)

case 1:

System.out.println();

System.out.println("Dear customer the vacant seats for this flight are 30, among which \n18 seats
are of economic class and 12 are of business class\nKindly choose your seat so that we can confirm
the booking ");

break;

case 2:

System.out.println();

System.out.println("Dear customer the vacant seats for this flight are 40, among which \n15 seats
are of economic class and 25 are of business class\nKindly choose your seat so that we can confirm
the booking ");

break;

case 3:

System.out.println();

System.out.println("Dear customer the vacant seats for this flight are 12, among which \n8 seats are
of economic class and 4 are of business class\nKindly choose your seat so that we can confirm the
booking ");

break;

case 4:

System.out.println();

System.out.println("Dear customer the vacant seats for this flight are 30, among which \n18 seats
are of economic class and 12 are of business class\nKindly choose your seat so that we can confirm
the booking ");

break;

break;

default:

System.out.println("Sorry... We don't have flight for these places");

break;

}
}

//Main file

import java.util.*;

import Bang.Banglore;

import Mumbai.Mumbai;

import Delhi.Delhi;

import Nagpur.Nagpur;

class airline

public static void main(String[] args)

Scanner sc = new Scanner(System.in);

String travel_class,name,date;

int eco_class=180,bus_class=120,count,age,i=0;

Delhi obj1 = new Delhi();

Mumbai obj2 =new Mumbai();

Nagpur obj3 =new Nagpur();

Banglore obj4 = new Banglore();

System.out.println("Welcome to SVS Airline Reservation !!!!");

System.out.println();

System.out.println("Kindly enter your name: ");

name=sc.next();

System.out.println("Enter your email:");

String email = sc.next();

System.out.println("Please enter the date of journey: ");

date=sc.next();

System.out.println();

System.out.println("Dear user kindly select your departure from the below: ");

System.out.println("1.Delhi\n2.Banglore\n3.Nagpur\n4.Mumbai");

String departure=sc.next();
switch(departure)

case "Delhi":

obj1.d();

break;

case "Mumbai":

obj2.mum();

break;

case "Nagpur":

obj3.nag();

break;

case "Banglore":

obj4.Ban();

break;

default:

System.out.println("Dear customer, the flights for "+departure+" are not available, sorry for the
inconvienece");

System.exit(0);

break;

System.out.println();

System.out.println("How many tickets do you want to book and in which class: ");

count = sc.nextInt();

travel_class=sc.next();

if(travel_class == "Economic class")

eco_class= eco_class-count;

else

bus_class=bus_class-count;

System.out.println("Dear customer, QR code for payment with amount has been send to your mail,
kindly pay the amount and confirm your booking");

System.out.println("Thank you for the booking... HAVE A GREAT JOURNEY!!");


}

You might also like