Variable Description

59
Variable description (entry) class Name Data Type Purpose obj, obj1 (object) Create objects for transfer control flow to travel or tourpackages input char Accept 1 for travels or 2 for tourpackages br (object) BufferedReader (choose) class * part of tourpackages package Name Data Type Purpose obj, obj1, obj2, obj3 (object) Create objects for transfer control to other classes to get information areachooser char Type for packages information 1 for North India, 2 for South India and Sri Lanka, 3 for East India and Bhutan, 4 for Central India tourchooser int Choose from 1 to 13 for any tour packages and information input int Accept 1 for proceeding with the booking and 2 for no.

description

Computer Variable description

Transcript of Variable Description

Page 1: Variable Description

Variable description

(entry) className Data Type Purpose

obj, obj1 (object) Create objects for transfer control flow to travel or tourpackages

input char Accept 1 for travels or 2 for tourpackages

br (object) BufferedReader

(choose) class * part of tourpackages packageName Data Type Purpose

obj, obj1, obj2, obj3 (object) Create objects for transfer control to other classes to get information

areachooser char Type for packages information 1 for North India, 2 for South India and Sri Lanka, 3 for East India and Bhutan, 4 for Central India

tourchooser int Choose from 1 to 13 for any tour packages and information

input int Accept 1 for proceeding with the booking and 2 for no.

e {exception} Exception

Page 2: Variable Description

(These classes just have tour packages information only)

(nitp) class * part of tourpackages package

(sitp) class * part of tourpackages package

(citp) class * part of tourpackages package

(eitp) class * part of tourpackages package

Page 3: Variable Description

(travelbook) class * part of tourpackages package

Name Data Type Purpose

name String Store name

passenger_name[] String Store passenger names

senior_citizen[] char StoreY or N whether the person is senior citizen or not.

depdate (object) departure date

check (object) check with present date

tdate int show present date

tmonth int show present month

tyear int show present year

no_of_pas int number of passengers

i int looping

r char Y or N whether the person is a senior citizen or not

n String It is used for storing the passenger name.

blank1 String Using substring, this variable is stored with date.

blank2 String Using substring, this variable is stored with month.

Page 4: Variable Description

blank3 String Using substring, this variable is stored with year.

dds int Used to parse numeric string

mms int Used to parse numeric string

yyyys int Used to parse numeric string

object (object)

input int It is used to type ‘Y’ or ‘N’ whether the user wants to proceeds with booking or not.

nd String Store departure date

(formfill) class * part of travel packageName Data Type Purpose

name String Store name

destination String Store destination

stpoi String Store starting point

mod String Store transport (aeroplane or bus or train)

depdate (object) Store departure date

retdate (object) Store returning date

choice char One Way or Round Way

d (object) Retrieve current date

obj1, obj (object)

age int Store age of user

e {Exception}

dds int Used to parse numeric string

mms int Used to parse numeric string

yyyys int Used to parse numeric

Page 5: Variable Description

stringddr int Used to parse numeric

stringmmr int Used to parse numeric

stringyyyyr int Used to parse numeric

stringblank1 String Using substring, this

variable is stored with date.

blank2 String Using substring, this variable is stored with month.

blank3 String Using substring, this variable is stored with year.

tdate int show present date

tmonth int show present month

tyear int show present year

nd, rd String Store departure date and returning date respectively.

i int loop

(info) class * part of travel package

Name Data Type Purpose

obj, obj1 (object) Create objects for transfer control flow to travel or tourpackages

trans String Store transport from mod variable

br (object) BufferedReader

input char Y or N whether the user is only travelling or not.

passengernames[] String store passenger names

senior_citizens[] char store Y or N whether the user is senior citizen or not.

r char Y or N whether the person

Page 6: Variable Description

is a senior citizen or notn String It is used for storing the

passenger name.input1 char to continue to ai class for

additional informationnum_of_pas int number of passengers

(ai) class * part of travel package

Name Data Type Purpose

obj, obj1 (object)

input1 char To store in which coach or class the user wants to travel.

d String store destination from ‘destination’

s String store starting point from ‘stpoi’

n String store name from ‘name’

mode String mode of transport

doc char Y or N – whether the

Page 7: Variable Description

person is a doctor or not.br (object) BufferedReader

input char Asking user to get either into night train or day train

confirm char Y for user to calculate the fare and N to exit.

e {Exception}

(calculate) class * part of account package

Name Data Type Purpose

obj, obj2, obj5, obj3 (object)

fare double store initial fare

hcess double store higher education cess

st double store service tax

tf double store total fare

Page 8: Variable Description

lt double store luxury tax

transfer char store coach/class code from input1

tray char store tourpackage number

e {Exception}

(confirmation) class * part of account package

Name Data Type Purpose

obj (object)

kb (object) Scanner class

input String store YES or NO for confirmation of ticket or itinerary

reason String reasons for rejecting the ticket.

reason1 String any additional reasons for rejecting the ticket.

reason2 String any additional reasons for rejecting the ticket.

(print) class * part of account packageName Data Type Purpose

obj, obj2, obj3, obj4, obj5 (object)

pr (object) PrintWriter class – Write into a file

bw (object) BufferedWriter class

Page 9: Variable Description

i int for looping

import java.io.*;import travel.*;import tourpackages.*;class entry{ public static void entry() throws IOException //Used for entry into class. { System.out.println("QWT Travels Agency welcomes you.");

formfill obj = new formfill(); choose obj1 = new choose(); BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

Page 10: Variable Description

System.out.println("QWT Travels Agency offers tour packages, sponsored by Cox & Kings and travels under \n aeroplane, bus, train to major cities in India.");

System.out.println("Choose 1 for travels or 2 for tour packages (OFFERED BY COX AND KINGS)"); char input = (char)br.read(); switch(input) // Based on user's input, one could go to either travels or tour packages. { case '1': obj.fill(); break; case '2': obj1.select(); break; default: System.out.println("Wrong range."); entry(); break; }

}

public static void main(String[] args) throws IOException // call entry method from main method. { entry(); }}

package tourpackages;

import java.io.*;import java.util.*;import account.*;public class choose{ public char areachooser; public static int tourchooser; public void select() throws IOException // select tour packages. { try

Page 11: Variable Description

{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); System.out.println("You told that you are interested in tour packages, offered by Cox & Kings."); System.out.println("NOTE: We don't have any West India tour package"); System.out.println("Type 1 for North, 2 for South (Sri Lanka included),\n 3 for East (Bhutan included), 4 for Central. "); areachooser =(char) br.read(); switch(areachooser) { case '1': nitp obj = new nitp(); System.out.println("We have tour packages - Golden Triangle, Golden Quadrangle,\n Enchanting Himachal, Himachal Splendour, Fascinating Uttarakhand, Heartland of Rajasthan.\n If you want to know more, press "); char initialise =(char) br.read(); System.out.println("1 for Golden Triangle, 2 for Golden Quadrangle,\n 3 for Enchanting Himachal, 4 for Himachal Splendour,\n 5 for Fascinating Uttarakhand, 6 for Heartland of Rajasthan..."); tourchooser = Integer.parseInt(br.readLine()); switch(tourchooser) // Based on user's choice, the appropriate package information is shown { case 1: obj.gt(); break; case 2: obj.gq(); break; case 3: obj.himd(); break; case 4: obj.schm(); break; case 5: obj.utd(); break; case 6: obj.raj(); break; default: System.out.println("Wrong range"); select(); } break; case '2': sitp obj1 = new sitp(); System.out.println("We have tour packages - Andaman - the Emerald Island, \n Sri Lanka - Tropical Paradise, Colours of Kerala.");

Page 12: Variable Description

char initialise1 =(char) br.read(); System.out.println("7 for Andaman - the Emerald Island, 8 for Sri Lanka - Tropical Paradise, \n 9 for Colours of Kerala."); tourchooser = Integer.parseInt(br.readLine()); switch(tourchooser) // Based on user's choice, the appropriate package information is shown { case 7: obj1.anda(); break; case 8: obj1.lk(); break; case 9: obj1.kerd(); break; default: System.out.println("Wrong range"); select(); } break; case '3': eitp obj2 = new eitp(); System.out.println("We have tour packages - Bhutan - the Himalayan Kingdom, Pearl of the East"); char initialise2 =(char) br.read(); System.out.println("10 for Bhutan - the Himalayan Kingdom, 11 for Pearl of the East"); tourchooser = Integer.parseInt(br.readLine()); switch(tourchooser) // Based on user's choice, the appropriate package information is shown { case 10: obj2.bhu(); break; case 11: obj2.odi(); break; default: System.out.println("Wrong range"); select(); } break; case '4': citp obj3 = new citp(); System.out.println("We have tour packages - Heartland of India, Heritage of Madhya Pradesh"); char initialise3 =(char) br.read(); System.out.println("12 for Heartland of India, 13 for Heritage of Madhya Pradesh"); tourchooser = Integer.parseInt(br.readLine());

Page 13: Variable Description

switch(tourchooser) // Based on user's choice, the appropriate package information is shown { case 12: obj3.hei(); break; case 13: obj3.hmp(); break; default: System.out.println("Wrong range"); select(); } } System.out.println("Proceed with the booking? Type 1 for YES, 2 for NO"); int input = Integer.parseInt(br.readLine()); switch(input) { case 1: System.out.println("You will be redirected to booking system. Please wait."); travelbook obj = new travelbook(); obj.booking(); // Control flow is transferred to booking method of travelbook class. break; case 2: System.out.println("Thank you. Good bye!"); System.exit(5); default: System.out.println("Wrong range. Please try again."); select(); break; }

} catch(Exception e) { System.out.println("Exception occurred."); } } } package tourpackages;import java.io.*;import java.util.*;import account.*;public class travelbook{ public static String name; public static String passenger_name[] = new String[5]; public static char senior_citizen[] = new char[5]; public static Calendar depdate = Calendar.getInstance(); public Calendar check = Calendar.getInstance(); public void booking() throws IOException // ascertain details of booking from passenger. {

try {

Page 14: Variable Description

int tdate = check.get(Calendar.DATE); int tmonth = check.get(Calendar.MONTH); int tyear = check.get(Calendar.YEAR); BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); System.out.println("Type your name?"); name = br.readLine(); System.out.println("How many are coming? Max 5."); int no_of_pas = Integer.parseInt(br.readLine()); // Number of passengers if (no_of_pas==1) { } else if (no_of_pas >=2 && no_of_pas<=5) { for (int i = 0; i<no_of_pas; i++) { System.out.println("Name of your "+(i+1)+" member?"); String n = br.readLine(); passenger_name[i]=n; System.out.println("Is he/she a senior citizen? Type Y or N"); char initialise = (char)br.read(); char r = (char)br.read(); senior_citizen[i] = r; } } else { System.out.println("Wrong range."); booking(); // Recursion done. } for (int i = 1; ; i++) { System.out.println("Type your departure date? (dd-mm-yyyy) [Today or later]"); String nd = br.readLine();

String blank1 = nd.substring(0,2); String blank2 = nd.substring(3,5); String blank3 = nd.substring(6); int dds = Integer.parseInt(blank1); int mms= Integer.parseInt(blank2); int yyyys=Integer.parseInt(blank3); // Used to ascertain date from user for departure if ( ((yyyys>=tyear) && (mms>=tmonth) && (dds>=tdate)) || ((yyyys>=tyear) && (mms>=tmonth) && (dds<=tdate))) { if ( (dds<=31) && (mms<=12) && (dds>=1) && (mms>=1) && (yyyys>=2014)) { depdate.set(Calendar.DATE, dds); depdate.set(Calendar.MONTH, mms); depdate.set(Calendar.YEAR, yyyys); break; }

Page 15: Variable Description

else { System.out.println("Date wrong."); System.out.println("Type again!"); continue; } } else { System.out.println("DATE OUT OF RANGE. PLEASE TYPE AGAIN"); continue; } } System.out.println("Do you wish to proceed to booking your seat? Type 1 for YES, 2 for NO"); int input = Integer.parseInt(br.readLine()); calculate object = new calculate(); switch(input) { case 1: object.tpcalc(); // Control flow transferred to calculate class. break; case 2: System.out.println("Thank you."); break; default: System.out.println("Wrong range."); } } catch (Exception e) { System.out.println("Exception occurred."); }

}}package tourpackages;class nitp{ void gq() // Golden Quadrangle { System.out.println("You have chosen the Golden Quadrangle, which covers the cities of Delhi, Agra, Jaipur and Gwalior."); System.out.println("Welcome to an enthralling tour through the four vibrant cities - Delhi, Agra, Jaipur and Gwalior \n also known as the Golden Quadrangle. Enjoy the trip that treasures \n the opulent vista of life! Allow the trip to acquaint you with cultural, historical and architectural hereditary\n magnificence of the capital of India, the city of love - Agra, fort city Gwalior and Jaipur, the Pink City."); System.out.println("Per 1 user - the cost is Rs.21336[07D/06N]. You can do:-"); System.out.println("Visit Taj Mahal, Explore Qutab Minar, Visit Hawa Mahal and Explore Gwalior Fort. These are must see!");

Page 16: Variable Description

} void gt() // Golden Triangle { System.out.println("You have chosen the Golden Triangle, which covers the cities of Delhi, Agra and Jaipur."); System.out.println("Welcome to an enthralling tour through the four vibrant cities - Delhi, Agra and Jaipur also known\n as the Golden Triangle. Enjoy the trip that treasures the opulent vista of life!\n Allow the trip to acquaint you with cultural, historical and architectural hereditary magnificence of the \n capital of India, the city of love - Agra and Jaipur, the Pink City."); System.out.println("Per 1 user - the cost is Rs.14183[05D/04N]. You can do:-"); System.out.println("Visit Mathura Temple, Taj Mahal, Agra Fort, Dayal Bagh.\n Visit Amer and Nahargarh Fort. These are must see!"); } void raj() // Rajasthan { System.out.println("You have chosen the Heartland of Rajasthan, which covers the main places of Rajasthan namely - Jaipur, Bikaner, Jaisalmer, Jodhpur and Udaipur."); System.out.println("Rajasthan, the Land of Kings and Rajputs, is an enduring legacy to India's history. \n Its diversified landscape of desert, lush plains and \n wooded Aravalli hills, since time immemorial has inspired poets, painters and writers.\n From the grim, impregnable forts of the kingdoms of Marwar and Amber to the delicate frescoes and screenwork of Shekhavati \n and the famous desert city of Jaisalmer, the jewels of India are here in this \n diverse and dramatic region."); System.out.println("Per 1 user - the cost is Rs.26699[09D/08N]. You can do:-"); System.out.println("Visit the magnificient Amber fort, take an excursion to Karni Mata temple.\n Travel to rugged desert city of Bikaner. See the exquisite temples at Ranakpur and visit the majestic Mehrangarh Fort. These are must see, if you go to Rajasthan!"); } void himd() // Himachal Enchanting { System.out.println("You have chosen Enchanting Himachal [Deluxe if appropriate], \n which covers the main places of Himachal Pradesh namely - Shimla, Manali, Chandigarh and Panchkula."); System.out.println("Himachal Pradesh is a beautiful hill state in northern India nestled in western Himalayas. The state \n is landlocked with the Tibetan Plateau to the east, Jammu & Kashmir to the north and Punjab to the \n west. However, the state stands apart from its neighbours in terms of its sheer\n topographic diversity and breathtaking pristine natural beauty.\n From vast tracts of high-altitude Trans-Himalayan desert to dense green deodar \n forests (from apple orchards to cultivated terrace farming) from snow capped high Himalayan mountain ranges to snow fed \n lakes and gushing rivers. Himachal has all of this mentioned and MORE....."); System.out.println("Per 1 user - the cost is Rs.21519[07D/06N] (For Deluxe- Rs. 27021[07D/06N]). You can do:-"); System.out.println("Explore the 457 year old Hadimba Devi Temple in Manali, Visit the Solang Valley to view snow capped mountains, \n surrender to the charms of nature in Kufri. These are must see if you go to Himachal Pradesh by chance!"); } void schm() // Himachal Splendour { System.out.println("You have chosen Himachal Splendour [Deluxe if appropriate], which covers the main places in Himachal Pradesh - Shimla, Manali, Dharamshala and Dalhousie.");

Page 17: Variable Description

System.out.println("The Himalayan Province is known across India for its pleasant \n early summer climate, mountain peaks, stunningly beautiful landscapes and deliciously cool mountain peaks,\n stunningly beautiful landscapes and deliciously cool mountain streams. Visit Shimla, famous as a British Hill Station, and Kullu and Manali which have beem perennial favourite \n destinations for over a decade. The chunky afforests with cool gentle winds, \n vast expansion of meadows, small quaint settlements and lovely orchards, give a majestic \n look to the serene ambiance of Manali."); System.out.println("Per 1 user - the cost is Rs.25493[08D/07N] (For Deluxe - Rs. 31270[08D/07N]). You can do:-"); System.out.println("Visit the charms of nature in Kufri, Visit Mall Road, \n summer capital of British time, \n Drive to Snow Point or Rohtang Pass to view the Snow capped peaks,\n Visit the Tibetan Monastery in Manali which houses several images \n of Lord Buddha and Tankha paintings,\n Visit Manikaran charms of natural hot spring. These are must see!"); } void utd() // Uttarakhand { System.out.println("You have chosen Fascinating Uttarakhand, which covers the main places \n of Uttarakhand namely, Nainital, Bhimtal, Kausani, Corbett,\n Ranikhet, Mussoorie and Kedarnath."); System.out.println("Blessed with magnificient glaciers, majestic snow-clad mountains, gigantic and ecstatic peaks,\n valley of flowers, skiing slopes and dense forests, this abode of Gods\n nestled in the mighty mountains. Uttarakhand promises its tourists a visit full of fun\n and unforgettable moments. Discover the unspoilt natural beauty of Uttarakhand Himalayas. Trekking,\n rafting, camping, bungee jumping, mountaineering, wildlife tours, jungle safari,\n paragliding and much more. Uttarakhand allures everyone from everywhere.\n The fresh air, the pure water, the chilling snow, the adversing mountains, the scenic beauty, the small villages, the simpler people\n and a tougher lifestyle is what that distinguishes Uttarakhand from rest of the world."); System.out.println("Per 1 user - the cost is Rs. 22233[07D/06N]. You can do-"); System.out.println("Experience the beautiful Saat Tal, a group of seven lakes in Nainital, enjoy beautiful panoramic view of the mighty Himalayan ranges at Gun Hill Point.\n Explore Corbett National Park - India's first National Park and the first sanctuary to come under Project Tiger.\n Panoramic view at Saat Tal and Hanumangarhi, explore the temples of Ranikhet, explore the holy Hindu places of Badrinath, Kedarnath, Gangotri,\n Yamunotri, Gaumukh and visit the Kempty Falls. These are must see if you go there!"); } }package tourpackages;class sitp{ void anda() // Andaman - The Emerald Island { System.out.println("You have chosen Andaman - The Emerald Island, which covers Port Blair, Havelock Island and the Neil Island."); System.out.println("The Andaman and Nicobar Islands are a veritable Garden of Eden is located in the Bay of Bengal.\n The clean environment, roads, greenery as well as unpolluted fresh air attract\n all nature lovers. The tropical rain forests and waters of Bay of Bengal are the home of a\n vast collection of plant, animal and marine life."); System.out.println("Per 1 user, the cost is Rs. 15864[05D/04N]. You can do:-"); System.out.println("Explore Corbyns Cove Beach, Sound and Light Show at Cellular Jail, Visit Neil Island,\n Visit North Bay Island, Visit Asia's best beach - the Radhanagar beach. [Catamaran ferry tickets to Havelock Island included]. You must see these!");

Page 18: Variable Description

} void lk() // Sri Lanka { System.out.println("You have chosen Sri Lanka - Tropical Paradise, which covers main places of Sri Lanka namely,\n Dambulla, Kandy, Bentota and Colombo."); System.out.println("Head for the rolling hills to escape the heat of the plains in the cool of tea plantations.\n The entire island of Sri Lanka is teeming with bird life, and exotics like elephants\n and leopards are not uncommon. To top it all off, the people are friendly, the food\n is delicious and costs are low."); System.out.println("Per 1 user, the cost is Rs. 31399[06D/05N]. You can do:-"); System.out.println("Excursion to Nuwara Eliya, Visit Dambulla Cave Temple, Spice Garden and Old Royal City in Kandy\n and the famous Buddhist temple in Mihintale."); } void kerd() // Kerala { System.out.println("You have chosen Colours of Kerala [Premium if chosen], which covers main places of Kerala namely\n - Kochi, Munnar, Thekkady, Kovalam, Kumarakom and Alappuzha."); System.out.println("Kerala, with a long shoreline with serene beaches, tranquil stretches of emerald backwaters,\n lush hill stations and exotic wildlife, waterfalls, sprawling plantations,\n paddy fields, ayurveda, magical festivals, historic monuments and exotic cuisine.\n.. all combined offer a traveller a unique experience. \n Kerala is popular as GOD'S OWN COUNTRY and is considered as India's most beautiful state. The lush greenery is an amazing \n sight and is a treat for the eyes."); System.out.println("Per 1 user, the cost is Rs. 28449[09D/08N] (For Premium, Rs. 57949[09D/08N]. You can do:-"); System.out.println("Travel to picturesque Munnar, walk through bustling Spice markets, walk around the tea gardens in\n Munnar and cruise on backwaters."); }}

package tourpackages;class citp{ void hei() // Madhya Pradesh { System.out.println("You have chosen Heartland of India [deluxe if chosen], which covers the \n places of Bhopal. Pachmarhi, Kanha and Jabalpur."); System.out.println("Few regions in India can match Madhya Pradesh for its sheer diversity,\n its rich heritage, legendary pilgrim centers, scenic beauty and wild life. Having three World Heritage sites\n - Bhimbetka, Khajuraho and Sanchi makes it a unique destination. Welcome to this much splendor\n land! Soak into the sensuality of Khajuraho, walk through the beautiful forts, ruins, monuments and museums,\n spot the tiger at Kanha and stay at a royal palace."); System.out.println("Per 1 user, the cost is Rs. 28978[06D/05N] (If deluxe, Rs. 37934[08D/07N]),\n you can do:-");

Page 19: Variable Description

System.out.println("Travel to the City of Lakes - Bhopal, Explore the Stupas, Monasteries\n and Temples at Sanchi, Visit Jata Shankar, Pandava Caves, Fairy Pool and Dhupgarh Point. These are a must-see!"); } void hmp() // Madhya Pradesh { System.out.println("You have chosen Heritage of Madhya Pradesh, which covers the places\n in Madhya Pradesh namely - Gwalior, Orchha and Khajuraho."); System.out.println("Madhya Pradesh, the Heart of India has been home to cultural heritage\n of Hinduism, Buddhism, Jainism and Islam. Innumerable monuments, exquisitely carved temples, stupas,\n forts and palaces are dotted all over the State. The natural beauty of Madhya Pradesh is equally varied.\n Consisting largely of a plateau, the State is richly endowed with spectacular mountain ranges, meandering\n rivers and miles and miles of dense forests offering a unique and exciting panorama of wildlife\n in sylvan surroundings."); System.out.println("Per 1 user, the cost is Rs. 18077[06D/05N]. You can do:-"); System.out.println("Visit temples at Khajuraho, Visit Jahangir Mahal and Chaturbhuj\n temple at Orchha and discover the rich cultural heritage of Gwalior. You must see them!"); } }

package tourpackages;class eitp{ void bhu() // Bhutan { System.out.println("You have chosen Bhutan - Himalayan Kingdom, which covers the main places of Kingdom of Bhutan namely \n - Phuentsholing, Paro, Thimphu and Punakha."); System.out.println("Bhutan often revered as the Land of the Peaceful Dragon. Its spectacular mountain terrain, varied flora \n and fauna and unique ancient Buddhist monasteries make it a must - visit destination.\n It is in the relatively unexplored pockets of Asia which allows only\n limited number of discerning travellers to enter the country in order to protect\n its fragile environment and culture. Bhutan, a purely Buddhist Himalayan Kingdom is unsurpassed in its scenic majesty\n and vibrant culture. It is the living heritage of Buddhism.");

Page 20: Variable Description

System.out.println("Per 1 user - the cost is Rs. 23999[06D/05N] (If [08D/07N] wanted, cost is Rs. 33299) You can do:-"); System.out.println("Visit BBS Tower - One can get a wonderful view of Thimphu valley from this point,\n explore National Memorial Chorten and Handicraft School - The School of Arts and Crafts, Visit Ta Dzong and Paro Dzong also.\n These are must see!"); } void odi() // Odisha { System.out.println("You have chosen Pearl of the East, which covers the main places of Odisha namely, Puri, \n Gopalpur and Bhubaneshwar."); System.out.println("Orissa is a land blessed with the virgin beauty of endless emerald green fields, \n meandering rivers dotted with picturesque villages, exquisite temples and monuments and long beaches.\n It is an attractive treasure house of cultures and customs, religions and traditions,\n languages and literature, art and architecture, scenic beauties and wildlife.\n The state once formed a part of Kalinga kingdom which is best known in ancient history for\n its brave resistance against the invasion of the Mauryan King Ashoka in the 3rd Century B.C."); System.out.println("Per 1 user - the cost is Rs. 21311[06D/05N]. You can do:-"); System.out.println("Visit the famous Jagannath Temple, Visit Sun Temple in Konark and enjoy an excursion to \n Chilika Lake. These are a must-see!!!"); }}

package travel;import java.io.*;import java.util.*;

public class formfill { public static String name; public static String destination; public static String stpoi; public static String mod; public static Calendar depdate = Calendar.getInstance(); public static Calendar retdate = Calendar.getInstance(); public static char choice;

Page 21: Variable Description

Calendar check = Calendar.getInstance(); public formfill() // Constructor to initialise data members to empty. { name = ""; destination = ""; stpoi = ""; mod = ""; } public void fill() throws IOException // get information about destination and starting point { try { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); formfill obj1 = new formfill(); System.out.println("Welcome to QWT Travel Agency. Here, you can book tickets by aircraft, train or bus to\n your favourite or required destination."); System.out.println("We require passenger information in order to get the booking done."); Date d = new Date(); System.out.println("Today's date is "+d); System.out.println("Passenger full name, age"); name = br.readLine(); int age = Integer.parseInt(br.readLine()); if (age<=18 || age>=100) { System.out.println("Not eligible."); fill(); } System.out.println("Where are you going? - You have the options - Delhi, Jaipur, Kolkata, Mumbai, Pune,\n Hyderabad, Bangalore, Chandigarh, Chennai and Thiruvanathapuram"); destination = br.readLine(); if (destination.equalsIgnoreCase("Delhi") || destination.equalsIgnoreCase("Jaipur") || destination.equalsIgnoreCase("Kolkata") || destination.equalsIgnoreCase("Mumbai") || destination.equalsIgnoreCase("Pune") || destination.equalsIgnoreCase("Hyderabad") || destination.equalsIgnoreCase("Bangalore") || destination.equalsIgnoreCase("Chandigarh") || destination.equalsIgnoreCase("Chennai") || destination.equalsIgnoreCase("Thiruvanathapuram")) { } else { System.out.println("Sorry, we don't cater to these destinations. Please try again."); fill(); } System.out.println("Where are you starting from? You have the options - Delhi, Jaipur, Kolkata, Mumbai,\n Pune, Hyderabad, Bangalore, Chandigarh, Chennai and Thiruvanathapuram"); System.out.println("If your starting point is not there, please select the nearest city. Please don't\n type destination and starting point same."); stpoi = br.readLine(); if (stpoi.equalsIgnoreCase(destination)) { System.out.println("Your destination name and starting point cannot be same. Please try again.");

Page 22: Variable Description

fill(); } else if (stpoi.equalsIgnoreCase("Delhi") || stpoi.equalsIgnoreCase("Jaipur") || stpoi.equalsIgnoreCase("Kolkata") || stpoi.equalsIgnoreCase("Mumbai") || stpoi.equalsIgnoreCase("Pune") || stpoi.equalsIgnoreCase("Hyderabad") || stpoi.equalsIgnoreCase("Bangalore") || stpoi.equalsIgnoreCase("Chandigarh") || stpoi.equalsIgnoreCase("Chennai") || stpoi.equalsIgnoreCase("Thiruvanathapuram")) { obj1.dateissue(); } else { System.out.println("Sorry, we don't have the starting points. If you are living in a nearby starting\n point, please type that city name only. Please try again."); fill(); } } catch(Exception e) { System.out.println("Exception occurred."); } } void dateissue() throws IOException // ascertain information about departure date and returning date { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String nd; String rd; int dds; int ddr; int mms; int mmr; int yyyys; int yyyyr; String blank1=""; String blank2 =""; String blank3=""; int tdate = check.get(Calendar.DATE); int tmonth = check.get(Calendar.MONTH); int tyear = check.get(Calendar.YEAR); try{ System.out.println("Do you want to go for One Way or Round Trip? O - One Way, R - Round Trip?"); choice = (char)br.read(); choice = Character.toUpperCase(choice);

switch(choice) { case 'O': char initialise = (char)br.read(); for (int i = 1; ; i++) { System.out.println("Type your departure date? (dd-mm-yyyy) [Today or later]");

Page 23: Variable Description

nd = br.readLine();

if (nd.length()==10) // Used to separate date, month and year by substring function { blank1 = nd.substring(0,2); blank2 = nd.substring(3,5); blank3 = nd.substring(6); } else if (nd.length()==8) { blank1 = nd.substring(0,1); blank2 = nd.substring(2,3); blank3 = nd.substring(4); } else { System.out.println("Date format not valid. Type in dd-mm-yyyy. Example: 09/08/2019 or 9/8/2019"); continue; } dds = Integer.parseInt(blank1); mms= Integer.parseInt(blank2); yyyys=Integer.parseInt(blank3); // Check if departure date is on the same date or later or typing correct date in correct format. if ( ((yyyys>=tyear) && (mms>=tmonth) && (dds>=tdate)) || ((yyyys>=tyear) && (mms>=tmonth) && (dds<=tdate))) { if ( (dds<=31) && (mms<=12) && (dds>=1) && (mms>=1) && (yyyys>=2014)) { depdate.set(Calendar.DATE, dds); depdate.set(Calendar.MONTH, mms); depdate.set(Calendar.YEAR, yyyys); break; } else { System.out.println("Date wrong."); System.out.println("Type again! Example: 09/08/2019 or 9/8/2019"); continue; } } else { System.out.println("DATE OUT OF RANGE. PLEASE TYPE AGAIN "); continue; } } transport(); break;

Page 24: Variable Description

case 'R': char initialise1 = (char)br.read(); System.out.println("Type your departure date? (dd-mm-yyyy) [Today or later]"); for (int i = 1; ; i++) {nd = br.readLine();

if (nd.length()==10) // Used to separate date, month and year by substring function { blank1 = nd.substring(0,2); blank2 = nd.substring(3,5); blank3 = nd.substring(6); } else if (nd.length()==8) { blank1 = nd.substring(0,1); blank2 = nd.substring(2,3); blank3 = nd.substring(4); } else { System.out.println("Date format not valid. Type in dd-mm-yyyy. Example: 09/08/2019 or 9/8/2019"); continue; } dds = Integer.parseInt(blank1); mms= Integer.parseInt(blank2); yyyys=Integer.parseInt(blank3); // Check if return date is on the same date or later or typing correct date in correct format. if ( ((yyyys>=tyear) && (mms>=tmonth) && (dds>=tdate)) || ((yyyys>=tyear) && (mms>=tmonth) && (dds<=tdate))) { if ( (dds<=31) && (mms<=12) && (dds>=1) && (mms>=1) && (yyyys>=2014)) { depdate.set(Calendar.DATE, dds); depdate.set(Calendar.MONTH, mms); depdate.set(Calendar.YEAR, yyyys); break; } else { System.out.println("Date wrong."); System.out.println("Type again!"); continue; } } else { System.out.println("DATE OUT OF RANGE. PLEASE TYPE AGAIN"); continue;

Page 25: Variable Description

} } for (int i = 1; ; i++) { System.out.println("Provide your return date? (dd-mm-yyyy) [Today or later]"); rd = br.readLine();

if (rd.length()==10) { blank1 = rd.substring(0,2); blank2 = rd.substring(3,5); blank3 = rd.substring(6); } else if (rd.length()==8) { blank1 = rd.substring(0,1); blank2 = rd.substring(2,3); blank3 = rd.substring(4); } else { System.out.println("Date format not valid. Type in dd-mm-yyyy. Example: 09/08/2019 or 9/8/2019"); continue; } ddr = Integer.parseInt(blank1); mmr= Integer.parseInt(blank2); yyyyr=Integer.parseInt(blank3); if ( ((yyyyr>=tyear) && (mmr>=tmonth) && (ddr>=tdate)) || ((yyyyr>=tyear) && (mmr>=tmonth) && (ddr<=tdate))) { if ((ddr<=31) && (mmr<=12) && (ddr>=1) && (mmr>=1) && (yyyyr>=2014)) { if ( (ddr>=dds) && (mmr>=mms) && (yyyyr>=yyyys)) { retdate.set(Calendar.DATE, ddr); retdate.set(Calendar.MONTH, mmr); retdate.set(Calendar.YEAR, yyyyr); break; } else { System.out.println("Return date less than departure date."); System.out.println("Type again!"); continue; } } else { System.out.println("Date wrong. Example: 09/08/2019 or 9/8/2019");

Page 26: Variable Description

System.out.println("Type again!"); continue; } } else { System.out.println("DATE OUT OF RANGE. PLEASE TYPE AGAIN"); continue; } } transport(); break; default: System.out.println("WRONG RANGE."); dateissue(); } } catch(Exception e) { System.out.println("Exception occurred."); } } void transport() throws IOException // mode of transport { System.out.println("Mode of travel (Aeroplane, Bus, Train)? to "+destination); BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); mod = br.readLine(); info obj = new info(); // Ascertain mode of transport if (mod.equalsIgnoreCase("Aeroplane") || mod.equalsIgnoreCase("Bus") || mod.equalsIgnoreCase("Train")) { System.out.println("You have selected "+mod); System.out.println("Please follow the required instructions..."); obj.collect_detail(); obj.trans=mod; } }}

package travel;import java.io.*;public class info{ public static String trans; public static String passengernames[] = new String[5]; public static char senior_citizens[] = new char[5]; void collect_detail() throws IOException // collect details on passenger and dependents coming with passenger {

Page 27: Variable Description

ai obj = new ai(); trans=formfill.mod;

try { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); if (trans.equalsIgnoreCase("Train")) { System.out.println("QWT has partnered up with IRCTC Train Services.");

System.out.println("Are you the only one travelling? Y/N"); char input = (char)br.read(); switch(input) { case 'Y':break; // If a passenger is not travelling, this part on passenger details is skipped. case 'N':

char initialise = (char)br.read(); System.out.println("How many are coming? Max 5."); int num_of_pas = Integer.parseInt(br.readLine()); for (int i = 0; i<num_of_pas; i++) { char initialise1 = (char)br.read(); System.out.println("Name of your "+(i+1)+" member?"); String n = br.readLine(); passengernames[i]=n; System.out.println("Is he/she a senior citizen? Type Y or N"); char r = (char)br.read(); senior_citizens[i] = r; }

} System.out.println("Would you like to book your seat now? Type Y for YES, N for NO"); char initialise2 = (char)br.read(); char input1 = (char)br.read(); switch(input1) { case 'Y': obj.collect_info(); break; case 'N': default: System.out.println("Thank you!"); break;

} } else if (trans.equalsIgnoreCase("Aeroplane")) { System.out.println("QWT has partnered up with Air India.");

Page 28: Variable Description

System.out.println("Are you the only one travelling? Y/N"); char input = (char)br.read(); switch(input) { case 'Y':break; case 'N':

char initialise3 = (char)br.read(); System.out.println("How many are coming? Max 5."); int num_of_pas = Integer.parseInt(br.readLine()); for (int i = 0; i<num_of_pas; i++) { char initialise4 = (char)br.read(); System.out.println("Name of your "+(i+1)+" member?"); String n = br.readLine(); passengernames[i]=n; System.out.println("Is he/she a senior citizen? Type Y or N"); char r = (char)br.read(); senior_citizens[i] = r; }

} System.out.println("Would you like to book your seat now? Type Y for YES, N for NO"); char initialise5 = (char)br.read(); char input1 = (char)br.read(); switch(input1) { case 'Y': obj.collect_info(); break; case 'N': default: System.out.println("Thank you."); break; } } else if (trans.equalsIgnoreCase("Bus")) { System.out.println("QWT has partnered up with ITDC.");

System.out.println("Are you the only one travelling? Y/N"); char input = (char)br.read(); switch(input) { case 'Y':break; case 'N':

char initialise6 = (char)br.read(); System.out.println("How many are coming? Max 5."); int num_of_pas = Integer.parseInt(br.readLine()); for (int i = 0; i<num_of_pas; i++)

Page 29: Variable Description

{ char initialise7 = (char)br.read(); System.out.println("Name of your "+(i+1)+" member?"); String n = br.readLine(); passengernames[i]=n; System.out.println("Is he/she a senior citizen? Type Y or N"); char r = (char)br.read(); senior_citizens[i] = r; }

}

char initialise7 = (char)br.read(); System.out.println("Would you like to book your seat now? Type Y for YES, N for NO"); char input1 = (char)br.read(); char w = (char)br.read();

switch(input1) { case 'Y': obj.collect_info(); break; case 'N': default: System.out.println("Thank you!"); break; } }

} catch (Exception e) { System.out.println("Exception occurred."); } }}

package travel;import java.io.*;import account.*;public class ai{ public static char input1='\u0000'; public static String d; public static String s; public static String n; public static String mode; public static char doc; static void collect_info() throws IOException // collect information from user about coach or class

Page 30: Variable Description

{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); info obj = new info(); d = formfill.destination; s = formfill.stpoi; n = formfill.name; mode = formfill.mod; try {

if (info.trans.equalsIgnoreCase("Train")) { System.out.println("For CONFIRMATION, your starting point is "+s); System.out.println("Your destination is "+d); System.out.println("You have two options. Either you can get into night train or day train? Type N for Night train, D for Day Train"); char input = (char)br.read();

switch(input) { case 'D': System.out.println("Which class do you want to go to? CC/2S. Type C for Chair Car, S for Second Sitting?"); char initialise = (char)br.read(); input1 = (char)br.read(); char initialise1 = (char)br.read(); break; case 'N': System.out.println("Which class do you want to go to? 1A/2A/EC/3A/SL. Type 1 for AC Tier 1, 2 for AC Tier 2, 3 for AC Tier 3, E for Executive Class, L for Sleeper Class."); char initialise2 = (char)br.read(); input1 = (char)br.read(); char initialise3 = (char)br.read(); break; default: System.out.println("Wrong Range. You are supposed to type D or N."); collect_info(); break; } } else if (info.trans.equalsIgnoreCase("Aeroplane")) { System.out.println("For CONFIRMATION, your starting point is "+s); System.out.println("Your destination is "+d);

System.out.println("You have two options. Either you can get into business class or economy class? Type B for business class, Y for economy class."); input1 = (char)br.read(); char initialise4 = (char)br.read(); } else if (info.trans.equalsIgnoreCase("Bus")) {

Page 31: Variable Description

System.out.println("For CONFIRMATION, your starting point is "+s); System.out.println("Your destination is "+d); }

System.out.println("Are you practising medicine? You could be of great help to passengers. Type Y or N"); char initialise5 = (char)br.read(); doc = (char)br.read(); System.out.println("Do you want to proceed with the booking? Y/N"); char confirm = (char)br.read(); if (confirm == 'Y') { System.out.println("You will be redirected to seat booking."); calculate obj1 = new calculate(); // Control flow transferred to calculate class. obj1.travelcalc();

} else { System.out.println("Thank you!!!"); }

} catch (Exception e) { System.out.println("Exception occurred."); } }

}

package account;import travel.*;import tourpackages.*;import java.io.*;public class calculate{ public double fare; double hcess; double st; public static double tf=0.0d; double lt; public void travelcalc() throws IOException /* Calculate fare for User from details given in Travel package.*/

Page 32: Variable Description

{

formfill obj = new formfill(); ai obj2 = new ai(); info obj5 = new info(); confirmation obj3 = new confirmation(); System.out.println("Your name is "+obj2.n); System.out.println("Your destination is "+obj2.d); System.out.println("Your starting point is "+obj2.s); System.out.println("Your mode of transport is "+obj2.mode); char transfer = obj2.input1;

try{ // Calculate fare on details given by user BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); if(obj2.mode.equalsIgnoreCase("Train")) { if (transfer == '1') { fare = 2100;

for (int y = 0; y<obj5.senior_citizens.length; y++) {

if (obj5.senior_citizens[y]=='Y') { fare-=(5/100)*fare; } } for (int y1 = 0; y1<obj5.passengernames.length; y1++) { if (obj5.passengernames[y1] == null) { break; } fare += fare; }

hcess = (1/100)*fare; st=(2/100)*fare; tf = fare+hcess+st;

} else if (transfer == '2') { fare = 1230; for (int y = 0; y<obj5.senior_citizens.length; y++) { if (obj5.senior_citizens[y]=='Y') { fare-=(5/100)*fare;

Page 33: Variable Description

} } for (int y1 = 0; y1<obj5.passengernames.length; y1++) { if (obj5.passengernames[y1] == null) { break; } fare += fare; } hcess = (1/100)*fare; st=(2/100)*fare; tf = fare+hcess+st; } else if (transfer == '3') { fare = 860; for (int y = 0; y<obj5.senior_citizens.length; y++) {

if (obj5.senior_citizens[y]=='Y') { fare-=(5/100)*fare; } } for (int y1 = 0; y1<obj5.passengernames.length; y1++) { if (obj5.passengernames[y1] == null) { break; } fare += fare; } hcess = (1/100)*fare; st=(2/100)*fare; tf = fare+hcess+st; } else if (transfer == 'E') { fare = 3780; for (int y = 0; y<obj5.senior_citizens.length; y++) {

if (obj5.senior_citizens[y]=='Y') { fare-=(5/100)*fare; } } for (int y1 = 0; y1<obj5.passengernames.length; y1++) {

Page 34: Variable Description

if (obj5.passengernames[y1] == null) { break; } fare += fare; } hcess = (1/100)*fare; st=(2/100)*fare; tf = fare+hcess+st; } else if (transfer == 'L') { fare = 325; for (int y = 0; y<obj5.senior_citizens.length; y++) {

if (obj5.senior_citizens[y]=='Y') { fare-=(5/100)*fare; } } for (int y1 = 0; y1<obj5.passengernames.length; y1++) { if (obj5.passengernames[y1] == null) { break; } fare += fare; } hcess = (1/100)*fare; st=(2/100)*fare; tf = fare+hcess+st; } else if (transfer == 'C') { fare = 1650; for (int y = 0; y<obj5.senior_citizens.length; y++) { if (obj5.senior_citizens[y]=='Y') { fare-=(5/100)*fare; } } for (int y1 = 0; y1<obj5.passengernames.length; y1++) { if (obj5.passengernames[y1] == null) { break; } fare += fare;

Page 35: Variable Description

} hcess = (1/100)*fare; st=(2/100)*fare; tf = fare+hcess+st; } else if (transfer == 'S') { fare = 185; for (int y = 0; y<obj5.senior_citizens.length; y++) {

if (obj5.senior_citizens[y]=='Y') { fare-=(5/100)*fare; } } for (int y1 = 0; y1<obj5.passengernames.length; y1++) { if (obj5.passengernames[y1] == null) { break; } fare += fare; } hcess = (1/100)*fare; st=(2/100)*fare; tf = fare+hcess+st; }

} else if (obj2.mode.equalsIgnoreCase("Aeroplane")) { fare = 9500;

if (transfer == 'B') { fare -= (5/100)*fare; for (int y1 = 0; y1<obj5.passengernames.length; y1++) { if (obj5.passengernames[y1] == null) { break; } fare += fare; } st = (15/100)*fare; tf = fare+st; } else if (transfer == 'Y') {

Page 36: Variable Description

fare -=(30/100)*fare; for (int y1 = 0; y1<obj5.passengernames.length; y1++) { if (obj5.passengernames[y1] == null) { break; } fare += fare; } st = (15/100)*fare; tf = fare+st; } } else if (obj2.mode.equalsIgnoreCase("Bus")) { fare = 500; for (int y1 = 0; y1<obj5.passengernames.length; y1++) { if (obj5.passengernames[y1] == null) { break; } fare += fare; } st = (10/100)*fare; tf = fare+st; } System.out.println("Total fare you have to pay is "+tf); obj3.confirmTL(); } catch (Exception e) {System.out.println("Exception occurred.");} }

public void tpcalc() throws IOException /* Calculate fare for User from details given in Tour package.*/ { travelbook obj = new travelbook(); choose obj1 = new choose(); confirmation obj2 = new confirmation(); int tray = obj1.tourchooser; try{ // Calculate itinerary on details given by user BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); if (tray==1) {

System.out.println("The package you have chosen is Golden Triangle."); fare = 14183; for (int y = 0; y<obj.senior_citizen.length; y++) { if (obj.senior_citizen[y]=='Y')

Page 37: Variable Description

{ fare-=(5/100)*fare; } } for (int y1 = 0; y1<obj.passenger_name.length; y1++) { if (obj.passenger_name[y1] == null) { break; } fare += fare; } hcess = (1/100)*fare; lt=(2/100)*fare; tf = fare+hcess+lt; } else if (tray==2)

{ System.out.println("The package you have chosen is Golden Quadrangle."); fare = 21336; for (int y = 0; y<obj.senior_citizen.length; y++) { if (obj.senior_citizen[y]=='Y') { fare-=(5/100)*fare; } } for (int y1 = 0; y1<obj.passenger_name.length; y1++) { if (obj.passenger_name[y1] == null) { break; } fare += fare; } hcess = (1/100)*fare; lt=(2/100)*fare; tf = fare+hcess+lt; } else if (tray==3) { System.out.println("The package you have chosen is Enchanting Himachal."); System.out.println("Do you want to go for Deluxe?"); char du = (char)br.read(); if (du == 'Y') {fare = 27021; } else {

Page 38: Variable Description

fare = 21519; } for (int y = 0; y<obj.senior_citizen.length; y++) { if (obj.senior_citizen[y]=='Y') { fare-=(5/100)*fare; } } for (int y1 = 0; y1<obj.passenger_name.length; y1++) { if (obj.passenger_name[y1] == null) { break; } fare += fare; } hcess = (1/100)*fare; lt=(2/100)*fare; tf = fare+hcess+lt; } else if (tray==4) { System.out.println("The package you have chosen is Himachal Splendour."); System.out.println("Do you want to go for Deluxe?"); char du = (char)br.read(); if (du == 'Y') {fare = 31270; } else { fare = 25493; } fare = 185; for (int y = 0; y<obj.senior_citizen.length; y++) { if (obj.senior_citizen[y]=='Y') { fare-=(5/100)*fare; } } for (int y1 = 0; y1<obj.passenger_name.length; y1++) { if (obj.passenger_name[y1] == null) { break; } fare += fare; } hcess = (1/100)*fare;

Page 39: Variable Description

lt=(2/100)*fare; tf = fare+hcess+lt; } else if (tray==5) { System.out.println("The package you have chosen is Fascinating Uttarakhand."); fare = 22233; for (int y = 0; y<obj.senior_citizen.length; y++) { if (obj.senior_citizen[y]=='Y') { fare-=(5/100)*fare; } } for (int y1 = 0; y1<obj.passenger_name.length; y1++) { if (obj.passenger_name[y1] == null) { break; } fare += fare; } hcess = (1/100)*fare; lt=(2/100)*fare; tf = fare+hcess+lt; } else if (tray==6) { System.out.println("The package you have chosen is Heartland of Rajasthan."); fare = 26699; for (int y = 0; y<obj.senior_citizen.length; y++) { if (obj.senior_citizen[y]=='Y') { fare-=(5/100)*fare; }

} for (int y1 = 0; y1<obj.passenger_name.length; y1++) { if (obj.passenger_name[y1] == null) { break; } fare += fare; } hcess = (1/100)*fare; lt=(2/100)*fare; tf = fare+hcess+lt; }

Page 40: Variable Description

else if (tray==7) { System.out.println("The package you have chosen is Andaman and Nicobar Islands."); fare = 15864; for (int y = 0; y<obj.senior_citizen.length; y++) { if (obj.senior_citizen[y]=='Y') { fare-=(5/100)*fare; } } for (int y1 = 0; y1<obj.passenger_name.length; y1++) { if (obj.passenger_name[y1] == null) { break; } fare += fare; } hcess = (1/100)*fare; lt=(2/100)*fare; tf = fare+hcess+lt; } else if (tray==8) { System.out.println("The package you have chosen is Lanka - Tropical Paradise."); fare = 31399; for (int y = 0; y<obj.senior_citizen.length; y++) { if (obj.senior_citizen[y]=='Y') { fare-=(5/100)*fare; } } for (int y1 = 0; y1<obj.passenger_name.length; y1++) { if (obj.passenger_name[y1] == null) { break; } fare += fare; } hcess = (1/100)*fare; lt=(2/100)*fare; tf = fare+hcess+lt; } else if (tray==9) { System.out.println("The package you have chosen is Colours of Kerala."); fare = 28449;

Page 41: Variable Description

for (int y = 0; y<obj.senior_citizen.length; y++) { if (obj.senior_citizen[y]=='Y') { fare-=(5/100)*fare; } } for (int y1 = 0; y1<obj.passenger_name.length; y1++) { if (obj.passenger_name[y1] == null) { break; } fare += fare; } hcess = (1/100)*fare; lt=(2/100)*fare; tf = fare+hcess+lt; } else if (tray==10) { System.out.println("The package you have chosen is Bhutan the Himalayan Kingdom."); System.out.println("Do you want to go for Deluxe?"); char du = (char)br.read(); if (du == 'Y') {fare = 33299; } else { fare = 23999; }

for (int y = 0; y<obj.senior_citizen.length; y++) { if (obj.senior_citizen[y]=='Y') { fare-=(5/100)*fare; } } for (int y1 = 0; y1<obj.passenger_name.length; y1++) { if (obj.passenger_name[y1] == null) { break; } fare += fare; } hcess = (1/100)*fare; lt=(2/100)*fare; tf = fare+hcess+lt;

Page 42: Variable Description

} else if (tray==11) { System.out.println("The package you have chosen is Pearl of the East."); fare = 21311; for (int y = 0; y<obj.senior_citizen.length; y++) { if (obj.senior_citizen[y]=='Y') { fare-=(5/100)*fare; } } for (int y1 = 0; y1<obj.passenger_name.length; y1++) { if (obj.passenger_name[y1] == null) { break; } fare += fare; } hcess = (1/100)*fare; lt=(2/100)*fare; tf = fare+hcess+lt; } else if (tray==12) { System.out.println("The package you have chosen is Heartland of India."); System.out.println("Do you want to go for Deluxe?"); char du = (char)br.read(); if (du == 'Y') {fare = 37934; } else { fare = 28978; } for (int y = 0; y<obj.senior_citizen.length; y++) { if (obj.senior_citizen[y]=='Y') { fare-=(5/100)*fare; } } for (int y1 = 0; y1<obj.passenger_name.length; y1++) { if (obj.passenger_name[y1] == null) { break; } fare += fare;

Page 43: Variable Description

} hcess = (1/100)*fare; lt=(2/100)*fare; tf = fare+hcess+lt; } else if (tray==13) { System.out.println("The package you have chosen is Madhya Pradesh."); fare = 18077; for (int y = 0; y<obj.senior_citizen.length; y++) { if (obj.senior_citizen[y]=='Y') { fare-=(5/100)*fare; } } for (int y1 = 0; y1<obj.passenger_name.length; y1++) { if (obj.passenger_name[y1] == null) { break; } fare += fare; } hcess = (1/100)*fare; lt=(2/100)*fare; tf = fare+hcess+lt; } System.out.println("Total fare you have to pay is "+tf); obj2.confirmTP(); } catch(Exception e) { System.out.println("Exception occurred."); } }}package account;import java.util.*;import java.io.*;class confirmation{ static void confirmTL() throws IOException // confirm travel ticket { Scanner kb = new Scanner(System.in); System.out.println("Would you like to confirm your ticket?(Yes/No)"); print obj = new print(); String input = kb.nextLine(); if (input.equalsIgnoreCase("YES")) {

Page 44: Variable Description

System.out.println("Your ticket is confirmed."); System.out.println("Thank you for choosing QWT Travels Agency."); obj.receiptTL(); } else if (input.equalsIgnoreCase("NO")) { reject(); } } static void confirmTP() throws IOException // confirm itinerary { Scanner kb = new Scanner(System.in); System.out.println("Would you like to confirm your ticket? (Yes/No)"); print obj = new print(); String input = kb.nextLine(); if (input.equalsIgnoreCase("YES")) { System.out.println("Your ticket is confirmed."); System.out.println("Thank you for choosing QWT Travels Agency."); obj.receiptTP(); } else if (input.equalsIgnoreCase("NO")) { reject(); } } static void reject() // reject ticket or itinerary { System.out.println("Would you like to reject your ticket?"); Scanner kb = new Scanner(System.in); String input = kb.nextLine(); if (input.equalsIgnoreCase("YES")) { System.out.println("Your ticket is cancelled."); System.out.println("May we know the reason why you cancelled the ticket?(OPTIONAL)- Subject first then body"); String reason = kb.nextLine(); String reason1 = kb.nextLine(); String reason2 = kb.nextLine(); System.out.println("By this "+reason+" you have cancelled the ticket. Come again!"); } }}

package account;import java.io.*;import java.util.*;import travel.*;import tourpackages.*;

Page 45: Variable Description

public class print{ static void receiptTL() throws IOException // Travel ticket for passenger { System.out.println("This receipt will be found as receiptTL.txt in the folder you are executing this program..."); System.out.println("You should know that this booking ticket is unconfirmed. To confirm it, you have to go to the train station or bus station or airport."); System.out.println("Officials will definitely accept tickets booked by QWT Travel Agency."); System.out.println("ALERT! Early Rush, Early Confirmation - Tickets booked by you should immediately be confirmed."); formfill obj = new formfill(); ai obj2 = new ai(); info obj5 = new info(); calculate obj3 = new calculate(); System.out.println("Your name is "+obj2.n); System.out.println("Your destination is "+obj2.d); System.out.println("Your starting point is "+obj2.s); System.out.println("Your mode of transport is "+ obj2.mode.toUpperCase()); BufferedWriter bw = new BufferedWriter(new FileWriter("receiptTL.txt",true)); PrintWriter pr = new PrintWriter(bw); pr.println("________________________________________________________________________________________________"); pr.println("------------------------------------------------------------------------------------------------"); pr.println(" QWT Travels Agency - approved by Govt. of India "); pr.println("Name of the passenger: "+obj2.n+" "); pr.println("Starting point of the passenger: "+obj2.d+" "); pr.println("Destination of the passenger: "+obj2.s+" "); pr.println("Mode of the passenger: "+obj2.mode+" "); for (int i = 0; i<obj5.passengernames.length; i++) { pr.println("Passenger "+(i+1)+" "+obj5.passengernames[i]+" "+obj5.senior_citizens[i]); } pr.println("Passenger's total fare is "+calculate.tf+" "); pr.println("Passenger's departure date "+formfill.depdate.get(Calendar.DATE)+"/"+formfill.depdate.get(Calendar.MONTH)+"/"+formfill.depdate.get(Calendar.YEAR)+" "); if (formfill.choice=='R') pr.println("Passenger's returning date "+formfill.retdate.get(Calendar.DATE)+"/"+formfill.retdate.get(Calendar.MONTH)+"/"+formfill.retdate.get(Calendar.YEAR)+" "); pr.println("Authorities concerned should take this amount in order to confirm the account."); pr.println("He/she has to produce two proofs of identities - Aadhaar, NPR, driving license, passport, PAN card, electricity bill or ration card or else the seat won't be confirmed."); pr.println("QWT Travels Agency doesn't take responsibility for any such circumstances caused to the passenger."); pr.println("Passenger who has booked for a train should wait (in case he has been given a WL ticket) for any status change. Same applies to RAC ticket holders."); pr.println("Passengers are required to abide by the law and guidelines of the DGCA and airways");

Page 46: Variable Description

pr.println("Wish the passenger happy journey............"); pr.close();System.exit(1); } static void receiptTP() throws IOException // Itinerary produced for user { System.out.println("This receipt will be found as receiptTR.txt in the folder you are executing this program..."); System.out.println("You should know that this itinerary is unconfirmed. To confirm it, you have to go to the train station or bus station or airport."); System.out.println("Officials will definitely accept itineraries booked by QWT Travel Agency."); System.out.println("ALERT! Early Rush, Early Confirmation - Itineraries booked by you should immediately be confirmed."); choose obj4 = new choose(); System.out.println("Your name is "+travelbook.name); BufferedWriter bw = new BufferedWriter(new FileWriter("receiptTR.txt", true)); PrintWriter pr = new PrintWriter(bw); pr.println("________________________________________________________________________________________________"); pr.println("------------------------------------------------------------------------------------------------"); pr.println(" QWT Travels Agency - approved by Govt. of India "); pr.println("Name of the passenger: "+travelbook.name+" "); pr.println("Package choosen by the passenger: "+obj4.tourchooser+"(Refer to coding given by QWT Travels Agency only. "); for (int i = 0; i<travelbook.passenger_name.length; i++) { pr.println("Passenger "+(i+1)+" "+travelbook.passenger_name[i]+" "+travelbook.senior_citizen[i]); } pr.println("Passenger's total fare is "+calculate.tf+" "); pr.println("Passenger's departure date "+travelbook.depdate.get(Calendar.DATE)+"/"+travelbook.depdate.get(Calendar.MONTH)+"/"+travelbook.depdate.get(Calendar.YEAR)+" "); pr.println("Authorities concerned should take this amount in order to confirm the seat."); pr.println("He/she has to produce two proofs of identities - Aadhaar, NPR, driving license, passport, PAN card, electricity bill or ration card or else the seat won't be confirmed."); pr.println("QWT Travels Agency doesn't take responsibility for any such circumstances caused to the passenger."); pr.println("Passenger should know that these packages are arranged by Cox & Kings"); pr.println("Wish the passenger happy journey! Have a nice sightseeing."); pr.close(); System.exit(1); } }