The program has three main sections
The functionality of the customer pages are
- searching for destination city
- reserving seat
- making changes to reservation and canceling reservation
The functionality of the ticketer secions includes Note: Ticketer must login to the page by providing correct password and ID number;
- searching for destination city
- making reservation and changes to reservation
- searching bus information
The only difference between these two section is that customer cannot search for bus information Why Ticketer section? This section for someone who maynot know how to reserve a seat, and needs help from the company. Most online registration system provides this type of services for their customre
The admisnistrator section includes the following functionality
- Adding/removing destination city, initial city and buses to the system
- Generating reports
- Overal administrator of the system
Description: When customer makes reservation the program, asks the customer for his/her bank account number and security code. Based on the account number and security code provided the transaction takes place. If customer provides a correct information, the program reduces the payement calculated for the reservation from his/her bank account. In case customer #cancels reseravation after (money reduced from his bank account), this library returns money back into a customer's bank account.
Each customer have account number starting from 1000 + their position, and randomly generated balance and security code between 1000 and 10000
This function takes 4 parameters, these parameters are how much money to be paid, account number, security code of the accountnumber and boolean information that tells whether the customer is reserving a seat or cancelling a reservation.
After taking parameters from the main program when customer makes reservation or cancels this function first checks if the account number and security code provided are correct and found in database.
After that it makes transaction provided during the paramtere passing(canceling or reserving seat).
In case of reserving a seat, this funcions reduces payement from customer bank account.
If customer wants to cancel his reservation, the money should be give back.
Description: The program ammends buses to cities. Example, if we have 4 buses and 2 cities A and B, the first two buses will be given to the city A, and the last two will be given to the other city B. These 2 buses that will travel to A, will have a bus destination code 100 as collective, and 100A and 100B individually. The individual buses under the same destination city is identified by bus code + letter. Each buses may have their own seats and leaving time.
create struct named Bus hat hold bus information such as bus destination code, number of buses, leaving time and number of seat available for each buses.
create struct named City that holds information about city like, city_name, distance from AA, direction from AA, and finally add a nested structure that appends bus information to each city.
Note: Creating default city and buses is useful. Default city and bus prevents the admnistrator providing city and buses information every time the program execution starts.
bus_city_info.h library is built for this purposes. it enables the user to reserve a seat and search for destination city before the administrator section of the program adding city and buses to the program
A new city is added to the lists of cities by creating a function that adds new city to structure dynamically using pointer new operator.
Administrator should provide name of the city, distance of the city from AA, and direction of the city from AA.
Bus will be ammended to the city at the instance new city is added by the administrator.
Another function removes cities from the list.
Only administrator have priveledge to remove cities from list of travelling.
create a default administrator and ticketer login information.
Administrator can add/remove ticketer from the organization, the same goes for ticketer login information.
Description: The main functionalities of this program includes
- providing interface for the customer, ticketer and admnistrator.
- responding to customer, ticketer and administrator requests. The main function of the program should be included here and all other functions from both libraries should be called in this program's main function.
Important libraries that should be included in this program are iostream, string, iomanip, cstdlib, cmath, ctime,and both user defined libraries bus_city_info.h and bankAccountNumber.h.
create struct named reserve that holds the customer's name, destination city, initial_city,
payement accountNumber, securityNumber, reserved seat, ticket size, return type, travelling distance, reserved bus leaving time, and age.
customer/ticketer shoul provide names, cities travelling to and from, type of travelling, age, preferred leaving time.
After receiving the above information from the customer/ticketer the function should ask for confirmation by providing bank account number and security code.
call a function that calculates distance.
Based on the cities customer/ticketer provided calculate a distance.
Algorithm for calculating distance.
Every Cities have distance and direction from central(Addis Ababa).
step 1: check whether both cities are on the same direction or not.
step 2: if both cites are on the same direction, the distance will be the difference between them.
step 3: if both cities are on different direction, check whether customer prefers direct way from starting to destination or through a central city
step 4: if customer prefers direct way, distance will be calculated by hypothenus formula.
step 5: if customer prefers to go through central, add two cities distance from central together.
step 6: return distance to reservation function, so that payement is calculated.
Payement is calculated based on the distance returned from distance_calculator() and price per kilometer.
calculate payement and return total payement
3.11 create a function that asks the customer/ticketer for confirmation of his/her reservation by showing his reservation information including payement
3.12 If customer confirms reservation call a function from bankAccountNumber.h library to perform transaction
this function should return status of transaction.
if status of transaction is okay, call a function that prints receipt and reserves actual seat.
Assign bus too.
else delete reservation transaction.