Page 471 - C++
P. 471

Bus Reservation
            A project to store record of buses, their fare and to generate ticket.

            struct Seat
            {
                   int total_seats,seat_bkd;
                   char Type;
                   float Rate;

            };
            struct date
            {
                   int dd,mm,yy;
            };
            class Bus
            {
                   int Bus_no;
                   char Starting_place[30],Destination[30];
                   Seat s;
                   public:
                   void FGetdata();
                   void FDisplaydate();
                   int Return_Busno{     return Bus_no; }
                   char *Return_Starting_place()       {      return Starting_place;  }
                   char *Return_Destination()          {      return Destination;   }
            };
            class Bus_Dep
            {
                   int Bus_no;
                   date Bus_date;
                   int hr,min;
                   int Busdep_no;
                   Seat s;
                   public:
                   void FDGetdata();
                   void FDDisplaydate();
                   int Return_Busno{     return Bus_no; }
                   int Return_seattype{  return s.Type; }
                   int Check_seat()
                   {
                          if (seat_bkd < total_seat)
                                 return 1;
                          else
                                 return 0;
                   }
                   void Update_seat()
                   {
                          s.seat_bkd++;
                   }
            };
   466   467   468   469   470   471   472   473   474   475   476