romeo6680
05-31-2009, 04:59 PM
Guys i really need help in this.
am not tht much into java can anyone help me programming this??
but please guys keep it simple like using substrings classes methods nd arrays.
thank you guys .
_________________________________________________________________
Write a java program the ask for the username and password in JOptionPane dialogue. If the username and password are correct let the user start entering commands that do the following Functions:
1- City Encoding and Decoding: In the function you have to build a static function that return takes a city code or name and return the city airport details information taken from the following file as a dataset: http://www.kovrik.com/sib/travel/iata-airport-codes.txt
Sample:
> dan Jeddah
Airport Code : JED Jeddah [King Abdul Aziz Airport], Saudi Arabia
>
2- Make a new reservation: In this function the user will enter the following command:
>res jeddmm14apr/2y/alali;mohammed ali/alali;sami ali
Once the user type the above command the function res should be called with the String input parameter " jeddmm14may/2y/alali;mohammed ali/alali;sami ali"
The function should automatically generate a unique reservation number of 8 digits and store the following reservation detail in a file named with the reservation number if there is availability in the availability flight files (which will be explained later) otherwise return No available flight to the user:
Departure City: JED
Destination City: DMM
Day: 14
Months: April
Year: 2010 //Note: the user doesn't have to enter the year because booking is only valid for the coming 12 months. E.g we are now in May 2009 so, booking is valid from May 2009 till April 2010
Class: Y
Number of seats: 2 //Note: 2y means 2 seats on the Y class. e.g. 1y means 1 seat on the Y class
Passenger 1:
Last Name: alali
Given Name: mohammed ali
Passenger 2:
Last Name: alali
Given Name: sami ali
3- A function to restore a booking details: The user should enter the following command in order to retrieve a reservation details:
>Ret 00001122
the function Ret should be called with the reservation number and then reads the file 00001122 and print its detail on the screen.
4- Modify booking:
>mod 00001122 followed by parameter needs to be modified code and the new value as follows:
cmed //means change the departure city to MED
diad //means change the destination city to IAD
r2 //means remove the second passenger and update the number of seats booked, similarly r1 will cancel the first passenger
p1bahjat;ahmedabdullah //means change the first passenger to bahjat;ahmedabdullah
gf //means change the class to First class
similarly gj change to business class and gy change to Y (Economy) class
t16 //means change the day to 16
mMay //means change the month to May
Note: For simplicity we remove the time from all reservations assuming there will be only one flight each day in each city pair.
Sample valid commands:
>mod 00001122 cmed;diad;gf //change departure city to MED ,destination to IAD and upgrade to First class
>mod 00001122 ddmm //change destination to DMM
>mod 00001122 ddmm;t19 //change destination to DMM and day 16
5- Add flight to Schedule: In this function you can add a flight details as follows:
>Add jedpar**May009F020J199Y
The above command should work as follows:
Add 30 flights(means 30 lines) (** means all days in May assuming every month is 30 days)
Each line will consist of the following details:
01 May JED PAR 009F 020J 199Y //this line means in 1st of May there will be a flight from JED to PAR and it has the following seats details: 9 seats on the first class, 20 seats on business class and 199 seats on Economy class
the line will be repeated for the 30 days of may from JED to PAR automatically so you availability.txt file should now consist of 30 lines. And it must be updated each time you make a new reservation from JED to PAR.
6- Schedule and Availability: In order to check the schedule and availability in a specific date between specific pair the user should enter the following command:
>Ava 15mayjedpar
This command should call function availability with a string parameter "15mayjedpar"
The function should print to the screen the available flight details taken from a file availability.txt maintained by the function on part 5 above.
The output of this function should be as follows:
15 May JED PAR 009F 020J 199Y
7- Exit: the user should write q! to exit from the system. Note that your application should run infinitely accepting user commands until the user issue the exit command.
8- You should output an error message for wrong input. E.g
>asdfasf
Wrong command
Phase 2:
Write a Ticket class with the following:
a- attributes:
PassengerName, mobile , reservationNumber, eTKT_Number,departure,destination,price.
Note: TKT number should be auto generated 16 digit number starts by 065210 which refer to airline code.
b- The class should have a constructor with all attributes.
c- Getters and setters.
d- Method print_Reservation:
This method should print the PNR(Passenger Name Record) for the current reservation which contains all the attributes plus the total price.
e- Get ticket detail for a file: this method should take a 16 digit ticket number
f- Method print ticket details
g- Method store ticket: this method should store the ticket details in a database file where all tickets details are stored. (assume file name is tkt.txt)
h- Link your class with the application built in Phase 1 by the following command:
>tkt 0612100000111123
the above command should print the ticket details (you can find the ticket details in tkt.txt file).
am not tht much into java can anyone help me programming this??
but please guys keep it simple like using substrings classes methods nd arrays.
thank you guys .
_________________________________________________________________
Write a java program the ask for the username and password in JOptionPane dialogue. If the username and password are correct let the user start entering commands that do the following Functions:
1- City Encoding and Decoding: In the function you have to build a static function that return takes a city code or name and return the city airport details information taken from the following file as a dataset: http://www.kovrik.com/sib/travel/iata-airport-codes.txt
Sample:
> dan Jeddah
Airport Code : JED Jeddah [King Abdul Aziz Airport], Saudi Arabia
>
2- Make a new reservation: In this function the user will enter the following command:
>res jeddmm14apr/2y/alali;mohammed ali/alali;sami ali
Once the user type the above command the function res should be called with the String input parameter " jeddmm14may/2y/alali;mohammed ali/alali;sami ali"
The function should automatically generate a unique reservation number of 8 digits and store the following reservation detail in a file named with the reservation number if there is availability in the availability flight files (which will be explained later) otherwise return No available flight to the user:
Departure City: JED
Destination City: DMM
Day: 14
Months: April
Year: 2010 //Note: the user doesn't have to enter the year because booking is only valid for the coming 12 months. E.g we are now in May 2009 so, booking is valid from May 2009 till April 2010
Class: Y
Number of seats: 2 //Note: 2y means 2 seats on the Y class. e.g. 1y means 1 seat on the Y class
Passenger 1:
Last Name: alali
Given Name: mohammed ali
Passenger 2:
Last Name: alali
Given Name: sami ali
3- A function to restore a booking details: The user should enter the following command in order to retrieve a reservation details:
>Ret 00001122
the function Ret should be called with the reservation number and then reads the file 00001122 and print its detail on the screen.
4- Modify booking:
>mod 00001122 followed by parameter needs to be modified code and the new value as follows:
cmed //means change the departure city to MED
diad //means change the destination city to IAD
r2 //means remove the second passenger and update the number of seats booked, similarly r1 will cancel the first passenger
p1bahjat;ahmedabdullah //means change the first passenger to bahjat;ahmedabdullah
gf //means change the class to First class
similarly gj change to business class and gy change to Y (Economy) class
t16 //means change the day to 16
mMay //means change the month to May
Note: For simplicity we remove the time from all reservations assuming there will be only one flight each day in each city pair.
Sample valid commands:
>mod 00001122 cmed;diad;gf //change departure city to MED ,destination to IAD and upgrade to First class
>mod 00001122 ddmm //change destination to DMM
>mod 00001122 ddmm;t19 //change destination to DMM and day 16
5- Add flight to Schedule: In this function you can add a flight details as follows:
>Add jedpar**May009F020J199Y
The above command should work as follows:
Add 30 flights(means 30 lines) (** means all days in May assuming every month is 30 days)
Each line will consist of the following details:
01 May JED PAR 009F 020J 199Y //this line means in 1st of May there will be a flight from JED to PAR and it has the following seats details: 9 seats on the first class, 20 seats on business class and 199 seats on Economy class
the line will be repeated for the 30 days of may from JED to PAR automatically so you availability.txt file should now consist of 30 lines. And it must be updated each time you make a new reservation from JED to PAR.
6- Schedule and Availability: In order to check the schedule and availability in a specific date between specific pair the user should enter the following command:
>Ava 15mayjedpar
This command should call function availability with a string parameter "15mayjedpar"
The function should print to the screen the available flight details taken from a file availability.txt maintained by the function on part 5 above.
The output of this function should be as follows:
15 May JED PAR 009F 020J 199Y
7- Exit: the user should write q! to exit from the system. Note that your application should run infinitely accepting user commands until the user issue the exit command.
8- You should output an error message for wrong input. E.g
>asdfasf
Wrong command
Phase 2:
Write a Ticket class with the following:
a- attributes:
PassengerName, mobile , reservationNumber, eTKT_Number,departure,destination,price.
Note: TKT number should be auto generated 16 digit number starts by 065210 which refer to airline code.
b- The class should have a constructor with all attributes.
c- Getters and setters.
d- Method print_Reservation:
This method should print the PNR(Passenger Name Record) for the current reservation which contains all the attributes plus the total price.
e- Get ticket detail for a file: this method should take a 16 digit ticket number
f- Method print ticket details
g- Method store ticket: this method should store the ticket details in a database file where all tickets details are stored. (assume file name is tkt.txt)
h- Link your class with the application built in Phase 1 by the following command:
>tkt 0612100000111123
the above command should print the ticket details (you can find the ticket details in tkt.txt file).