It is a Menu based program in which we ask user to give his choice. A menu is displayed in which there are options like time table, reservation, add remove route etc. The control is passes to the module which is associated with the choice selected by the user. If the option is for time-table then the records about all records are displayed.
If the option is for add or remove route, a menu prompts for a choice to add or remove route. If the choice is to add route then the user is asked several questions about Route no, No. of bus, Starting point, Destination, Fare and Departing Time, and the format of each input is checked. If the format is not correct then the user is asked to give input in required format like date is required in format of dd/mm/yyyy. The given record is checked with the stored records, if the record exists, then an error message is displayed stating that the record already exists. If the record does not exist then the time-tab file is opened in which record is written. Then the user is asked if he want to insert more records, if the answer is yes then the whole procedure is repeated else the file is closed and the control passes back to the main program.
If the option is for remove route then the user is asked to give route no. of the record of the route to be deleted. Then the record is searched in the file if it exists or not. If it does not exist an error message is displayed. If the required exist a conformation is demanded that 'Are you sure you want to delete this route'. If the answer is yes then the deleting of record is done. The route record is deleted form time-tab file. The user is asked if he wants.
If the user want to reserve seats in a route then the several inputs are required i.e. information about Date of Journey, Route no. and number of passengers i.e. number of seats to be reserved. If the information is valid and correct the file is checked for the number of available seats. If less number of seats are available then the no. of available seats is displayed else the information about passengers is asked like name of passenger, sex, age etc. it is continued until the input about all passengers is got. The records are written into the file.
If the user want to cancel seats in a route then the several inputs are required i.e. information about Route no. and seat no. If the information is valid and correct the file is checked for that seat. If the give input is correct than the record corresponding to that seat is deleted. Then the user is asked if he want to delete more seats. If the answer is yes then this procedure is continued until the required no. of seats get deleted. The records are deleted into the file.
In case of Inquiry the user is asked to give the Date of Journey & Route no. Then all the records are displayed in which user can get the required information. In case of preponment the user is asked to give the required information about Date of Journey, Route no., Starting point, Destination and Seat no. and Date to be transferred to an earlier date. The Starting Point & destination are compared with all the other records of the required date. If the places exist on any route on that date then the record of that seat no. are transferred to that date otherwise an error message is displayed.
In case of postponement the user is asked to give the required information about Date of Journey, Route no., Starting Point, Destination, Seat no. and Date to be transferred to an post date. The Starting Point & destination are compared with all the other records of the required date. If the places exist on any route on that date then the record of that seat no. are transferred to that date otherwise an error message is displayed.