Escolar Documentos
Profissional Documentos
Cultura Documentos
Display
1. Login as user
2. Login as admin
3. Exit
If option == 1 If option == 2
Display
1.New
Display Welcome Admin
registration
Han
2.Login What would you like to do
3.Exit today
1- View Trains
2- View Users
3 – Approve Cancellations
4 – View confirmed
Prompt reservations
user to 5 - Exit
input
useroption
If useroption == 2
If useroption == 1
Prompt
Read
Read train.txt Read user.txt confirm.txt
admin to exit
Display
Read cancellation.txt the program
Display
Username :
Username
Password :
Prompt
user to
continue to Read
main menu confirm.txt
Checker == 1 If option == 1 If option == 2 If option == 3
If option == 1 Exit
Display
Display 1.Booking Display
Password 2.Update Display Display Prompt Confirm[i].username,
Display
While checker !=0 entered are 3.Cancellation Enter train Change Change admin to Confirm[i].dep,
different, try user user menu Confirm[i].des,
again
4.View name :
Confirm[i].date,
Reservations Enter date
Confirm[i].name,
5. Search : Confirm[i].hp_no,
Reservations Confirm[i].gender
6.Exit
Display
Account Checker = 0
successfully Display
created! Read train.txt "Change
password Read train.txt If option == 6
If option == 2 If option == 3 If option == 4 If option == 5
If option == 1 from %s to :
",User[i].user
pw
Display
Unable to
If checker != 1
find Display
Display username Display Logging
Train[i].trainNam Train[i].trainName, out
Display
e, Train[i].date, Train[i].date,
Please
select the
Train[i].trainDep, Display Display Train[i].trainDep,
Train[i].trainDes, Updating Cancellation Train[i].trainDes, Display
date you Read confirm.txt
Train[i].space Train[i].space Reservations
wish :
Display Display
Username Thanks for
changed! using this
program
Read Display
confirm.txt Approved Display
Prompt Read confirm.txt Read confirm.txt Search for
user to reservation
input date
Exit
Display
"No", Prompt user
Display "No", to enter
Read train.txt "Departure", "Departure", Display No",
"Destination phone
"Destination", "Departure",
", "Date", number
"Date", "Destination",
"Fullname"," "Fullname", "Passenger
Gender" "Gender" Name", "Tel No"
Index == 1
Prompt user
to choose Prompt user Prompt user
choice to If Confirm[i].hp_no Exit to user
to select to return to
update == hp_no menu
reservation user menu
to cancel
Print
Departures
Display
Display Reasons
1 – Date
2 – Change to cancel
departure 1.Unable to make
and it in time
destination 2.Personal Issues
3.Emergency Display
Index++ 4.No Specific "No",
Reason "Departure",
"Destination
", "Passenger
Prompt user Name", "Tel
to choose No"
choiceA to
Prompt update Append
user to cancellation.txt
select
departure
If choiceA == 1 If choiceA == 2
Index == 1
Display
Please Read train.txt
select the
date you Display
Display Display No
wish to "Unable to Display
Personal Specific
change to make it in Emergency
Print Issues Reason
time."
Destinations
Display
"No",
"Departure",
"Destination
"
If choice3 <=31 && Exit to
choice3 > 0 menu
Index++
Close
cancellation.txt
Prompt user
to input
choice
Prompt Display
user to Date has
select been
changed!
destination
Read confirm.txt
Prompt
user to
If Train[i].space == 0 user info
Prompt user
to select
new
departure
and
destination
Display
Train is full
Display
Destination
and
departure
Display
has been
Name : changed
Please enter
your phone
number :
Please Select
your gender :
1.Male
2.Female
Open
confirm.txt
If gender == 2
If gender == 1
Display
Display
Female
Male into
into
confirm.txt
confirm.txt