0% found this document useful (0 votes)
24 views28 pages

computer project

The document outlines a travel agency program created by Ananya Deepak Kadam, which includes an algorithm, flow chart, source code, and data dictionary for booking transportation. The program allows users to input personal details and select their mode of transport (Airplane, Train, or Bus), with various options for classes and pricing. It also generates a bill receipt based on user selections and displays the total amount due.

Uploaded by

ananyak454
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views28 pages

computer project

The document outlines a travel agency program created by Ananya Deepak Kadam, which includes an algorithm, flow chart, source code, and data dictionary for booking transportation. The program allows users to input personal details and select their mode of transport (Airplane, Train, or Bus), with various options for classes and pricing. It also generates a bill receipt based on user selections and displays the total amount due.

Uploaded by

ananyak454
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 28

Computer

Application
School name- Mount St Patrick
Academy
Name-Ananya Deepak Kadam
Class- 9
Division-B
Roll No.-2
Internal Examiner-
External Examiner-
Index
1. Name
2. Algorithm
3. Flow chart
4. Source Code
5. DDT
Algorithm
Step 1. Start program
Step 2. Accept user’s name
Step 3. Accept number of passengers
Step 4. Accept departure date
Step 5. Accept departure month
Step 6. Accept departure year
Step 7. Accept user’s contact number
Step 8. Accept user’s email id
Step 9. Accept user’s start location
Step 10. Accept user’s destination
Step 11. Offer choice of mode of transport (Airplane ,
Train and Bus)
Step 12. Enter the choice
Step 13. If user’s choice is 1 (Airplane), then:
(A) (a) Offer choice of class in Airplane ( Business
Class,
First Class, Economy Class )
(b) Calculate the amount according to the choice and
print the bill
Step 14. Else if user’s choice is 2 (Train), then:
(B) (a) Offer choice of Type of train(Ordinary Train,
Express Train, Super-fast Train, ROYAL ETERNITY)
(1) If the user’s choice 1 (Ordinary train),then:
(2) Offer choice of type of coach (A.C class,
Sleeper class , Sitting class)
(3) Calculate the amount according to the choice
and print the bill
(b) Else if user’s choice is 2 (Express Train),then:
(1) Offer choice of Type of train(First A.C , Second
A.C, Third A.C , Sleeper class)
(2) Calculate the amount according to the choice
and print the bill
(c) Else if user’s choice is 3 (Super-fast Train),then:
(1) Offer choice of Type of train(First A.C , Second
A.C, Third A.C , Sleeper class)
(2) Calculate the amount according to the choice
and print the bill
(d) Else (ROYAL ETERNITY)
(1) Offer choice of coach(ROYAL ETERNITY
PREMIUM, ROYAL ETERNITY GOLD, ROYAL
ETERNITY MAX)
(2) Calculate the amount according to the choice
and print the bill
Step 15. Else, user’s choice 3 (Bus)
(C) (a) Offer choice of bus(A.C and NON-A.C)
(1) If user’s choice is 1, (A.C Bus), then:
(2) Offer choice of type of bus(Normal sitting
bus, Sleeper)
(3) Calculate the amount according to the choice
and print the bill
(b) (1) If user’s choice 2, (NON-A.C bus),then:
(2) Offer choice of type of bus(Normal sitting bus,
Sleeper)
(3) Calculate the amount according to the choice
and print the bill
Flow Chart

Start
int
p,dd,mm,yy,choice,apclass,amount=0,supc,expc,ordc,ete
rnc,busc,bust,trainc
long cn
String n, d, sl="/", eml, ru="₹",l

Display Main menu


1. Airplane
2. Train
3. Bus

Condition 1 Condition 2 Condition 3


(1.Airplane) (2. Train) (3. Bus)
1. Business Class 1. Ordinary Train

2. First Class 2. Express Train

3. Economy Class 3. Super-fast Train

4. ROYAL ETERNITY

1. A.C class 1. First A.C 1. First A.C


2. Sleeper class 2. Second A.C 2. Second A.C
3. Sitting class 3. Third A.C 3. Third A.C
4. Sleeper class 4. Sleeper class

1. ROYAL ETERNITY PREMIUM


2. ROYAL ETERNITY GOLD
3. ROYAL ETERNITY MAX
1. Air conditioned (A.C) Bus 2. Non-AC Bus
1. Normal sitting bus 1. Normal sitting bus
2. Sleeper 2. Sleeper

End

Source Code
import java.util.*;
class travel_agency
{
public static void main (String args[])
{
Scanner in=new Scanner(System.in);
int
p,dd,mm,yy,choice,apclass,amount=0,supc,expc,ordc,eternc,bu
sc,bust,trainc;
long cn;
String n,d,sl="/",eml,ru="₹",l;
System.out.println("Welcome to Safe Travels With Us");
System.out.println("Please enter the required Credentials");
System.out.println("Enter your Full Name");
n=in.nextLine();
System.out.println("Enter number of passengers");
p=in.nextInt();
System.out.println("Enter Departure date in form of DD");
dd=in.nextInt();
System.out.println("Enter Departure month in form of MM");
mm=in.nextInt();
System.out.println("Enter Departure Year in form of YY");
yy=in.nextInt();
System.out.println("Enter Contact no.");
cn=in.nextLong();
System.out.println("Enter your email id");
eml=in.next();
System.out.println("please enter your start location");
l=in.next();
System.out.println("Please enter your destination");
d=in.next();
System.out.println("Please choose your transport from
following options");
System.out.println("1. Aeroplane");
System.out.println("2. Train");
System.out.println("3. Bus");
choice=in.nextInt();
if(choice==1)
{
System.out.println("Which class do you want to travel in?");
System.out.println("1.Business Class - ₹14000");
System.out.println("2.First Class - ₹10000");
System.out.println("3.Economy Class - ₹8500");
apclass=in.nextInt();
if(apclass==1)
amount=14000*p;
else if(apclass==2)
amount=10000*p;
else
amount=8500*p;
}
else if(choice==2)
{
System.out.println("Which type of train do you want?");
System.out.println("1.Ordinary Train");
System.out.println("2.Express Train");
System.out.println("3.Super-fast Train");
System.out.println("4. ROYAL ETERNITY");
trainc=in.nextInt();
if(trainc==1)
{
System.out.println("Which type of coach do you want?");
System.out.println("1.A.C class -- ₹2400");
System.out.println("2.Sleeper class -- ₹1690");
System.out.println("3.Sitting class --- ₹750");
supc=in.nextInt();
if(supc==1)
amount=2400*p;
else if(supc==2)
amount=1690*p;
else
amount=750*p;
}
else if(trainc==2)
{
System.out.println("Which type of coach do you want?");
System.out.println("1.First A.C -- ₹3200");
System.out.println("2.Second A.C -- ₹2790");
System.out.println("3.Third A.C -- ₹2250");
System.out.println("4. Sleeper class -- ₹1720");
expc=in.nextInt();
if(expc==1)
amount=3200*p;
else if(expc==2)
amount=2790*p;
else if(expc==3)
amount=2250*p;
else if(expc==4)
amount=1720*p;
}
else if(trainc==3)
{
System.out.println("Which type of coach do you want?");
System.out.println("1.First A.C -- ₹4000");
System.out.println("2.Second A.C -- ₹3200");
System.out.println("3.Third A.C -- ₹2750");
System.out.println("4. Sleeper class -- ₹2000");
ordc=in.nextInt();
if(ordc==1)
amount=4000*p;
else if(ordc==2)
amount=3200*p;
else if(ordc==3)
amount=2750*p;
if(ordc==4)
amount=2000*p;
}
else
{
System.out.println("Which coach do you want?");
System.out.println("1. ROYAL ETERNITY PREMIUM -- ₹30000");
System.out.println("2. ROYAL ETERNITY GOLD -- ₹26000");
System.out.println("3. ROYAL ETERNITY MAX -- ₹20000");
eternc=in.nextInt();
if (eternc==1)
amount=30000*p;
else if(eternc==2)
amount=26000*p;
else if(eternc==3)
amount=20000*p;
}
}
else
{
System.out.println("Which bus do you want");
System.out.println("1.Air conditioned(A.C) Bus");
System.out.println("2.Non-AC Bus");
busc=in.nextInt();
if(busc==1)
{
System.out.println("Which type of bus do you want?");
System.out.println("1.Normal sitting bus--- ₹450 per head");
System.out.println("2.Sleeper--- ₹750 per head");
bust=in.nextInt();
if(bust==1)
amount=450*p;
else if(bust==2)
amount=750*p;
}
else
{
System.out.println("Which type of bus do you want?");
System.out.println("1.Normal sitting bus--- ₹250 per head");
System.out.println("2.Sleeper--- ₹450 per head");
bust=in.nextInt();
if(bust==1)
amount=250*p;
if(bust==2)
amount=450*p;
}
}
System.out.println("**********************BILL
RECIEPT**********************");
System.out.println("Customer name ---\t"+n);
System.out.println("Phone number ---\t"+cn);
System.out.println("Customer email adress ---\t"+eml);
System.out.println("Departure date ---\t"+dd+sl+mm+sl+yy);
System.out.println("Number of passenger ---\t"+p);
System.out.println("From ---\t"+l);
System.out.println("To---\t"+d);
System.out.println("Amount ---\t"+ru+amount);
System.out.println("Contact us --- 7620552103");
System.out.println("Thank you!!!");
}
}
Output
Welcome to Safe Travels With Us

Please enter the required Credentials

Enter your Full Name

Ananya Kadam

Enter number of passengers

Enter Departure date in form of DD

17

Enter Departure month in form of MM

11

Enter Departure Year in form of YY

23

Enter Contact no.

8149884488

Enter your email id

[email protected]

Please enter your start location

Pune

Please enter your destination

Goa
Please choose your transport from following options

1. Airplane

2. Train

3. Bus

Which type of train do you want?

1.Ordinary Train

2.Express Train

3.Super-fast Train

4. ROYAL ETERNITY

Which coach do you want?

1. ROYAL ETERNITY PREMIUM -- ₹30000

2. ROYAL ETERNITY GOLD -- ₹26000

3. ROYAL ETERNITY MAX -- ₹20000

**********************BILL RECIEPT**********************

Customer name --- Ananya Kadam

Phone number --- 8149884488

Customer email adress --- [email protected]


Departure date --- 17/11/23

Number of passenger --- 1

From --- Pune

To--- Goa

Amount ---₹30000

Contact us --- 4313789450

Thank you!!!

DDT
Data type Variable Description
Int p To store
number of
passengers
Int dd To store date
Int mm To store month
Int yy To store year
Int choice To store choice
of user’s for
mode of
transport
Int apclass To store user’s
choice for class
Int amount To calculate
amount
Int supc To store user’s
choice for type
of coach
Int expc To store user’s
choice for type
of coach
Int ordc To store user’s
choice for type
of coach
Int eternc To store user’s
choice for type
of coach
Int busc To store user’s
choice for type
of bus
Int bust To store user’s
choice for type
of bus
Int trainc To store user’s
choice for type
of train
Long cn To store user’s
contact number
String n To store user’s
name
String d To store user’s
destination
String sl /
String eml To store user’s
email.id
String ru Rupees sign
String l To store user’s
start location

You might also like