Reserve Me A Seat!
Ever reserved a seat in a cinema? Which seats would you
prefer?
Do you think there is any priority for allocating you a seat
in a cinema? No, there is no condition based allocation.
What about buses and trains?
Yes there can be priority wise allotments. There can be
several criteria for determining the priority. When we talk about the Railway Reservation
System, what can we take into consideration for determining the Priority?
Age : We can prioritize the reservation for
senior citizens
Gender :
We can prioritize the reservation for female citizens
Disability : Handicapped citizens are given the
priority
Quota : General waiting > Tatkal > foreign quota
In one of our previous blogs, we went through the reservation
– booking and cancellation blocks. After the user inputs all the above
information during booking process, we can check the priority at administrative
end. Let us consider the Age and Gender as our criteria.
The function can be inherited from the functions of passenger class and
operator class.
We check the age and gender of the current code the pointer
is pointing to. Where is this priority checked? After the user enters age and
gender, call the priority function in
reservation block and return back the priority.
new_node->priority=priority(new_node);
if(new_node->priority==0)
{
cout<<"\n\n\t\t\t\tREGISTRATION UNSUCCESSFUL";
}
In
the priority code, we can add the user in waiting list if the train gets full. We
can also use the different criteria mentioned earlier for determining the
priority. Priority determination is very important in a system like - Railway Reservation.
Now that we are done with selecting our priorities, we must head towards the user-friendly functions in our system.
Your Seat has been booked, you can continue with our blog!
- Aditya Wyawahare
(K84)
Fabulous
ReplyDeleteThank you for your comment! Feel free to ask any doubts!
DeleteNice work man!
ReplyDeleteThank you for your comment! Feel free to ask any doubts!
DeleteGood read
ReplyDeleteThank you for your comment! Feel free to ask any doubts!
ReplyDeleteGood
ReplyDeleteThank you for your comment! Feel free to ask any doubts!
DeleteGood
ReplyDeleteThank you for your comment! Feel free to ask any doubts!
Deletewow..nice
ReplyDeleteThank you for your comment! Feel free to ask any doubts!
DeleteThis comment has been removed by the author.
ReplyDelete