Jommiey

Lektion3_1

Nov 19th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.81 KB | None | 0 0
  1. class Vehicle
  2. {
  3. public:
  4.   unsigned int get_number_of_wheels() const;
  5.   unsigned int get_max_speed() const;
  6.  
  7.   Location& get_start_point() const;
  8.   Location& get_destination() const;
  9.  
  10. protected:
  11.   unsigned int number_of_wheels;
  12.   unsigned int max_speed;
  13.   Location start_point; //made-up class Location
  14.   Location destination; //made-up class Location
  15. };
  16.  
  17. class Passenger_Vehicle : public Vehicle
  18. {
  19. public:
  20.   unsigned int get_number_of_passengers() const;
  21.   unsigned int get_number_of_doors() const;
  22.  
  23. private:
  24.   unsigned int number_of_passengers;
  25.   unsigned int number_of_doors;
  26. };
  27.  
  28.  
  29. class Freight_Vehicle: public Vehicle
  30. {
  31. public:
  32.   unsigned int get_max_payload() const;
  33.   void load_freight_vehicle();
  34.   Load& unload_freight_vehicle(); //made-up class Load
  35.  
  36. private:
  37.   unsigned int max_payload;
  38. };
Add Comment
Please, Sign In to add comment