Advertisement
Guest User

vehicle(1)

a guest
Jul 15th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.90 KB | None | 0 0
  1. #ifndef VHC_H
  2. #define VHC_H
  3. #include <iostream>
  4. using namespace std;
  5.  
  6. class Vehicle{
  7. private:
  8.     string manufacturer;
  9.     int seat;
  10. protected:
  11.     string type;
  12. public:
  13.     Vehicle(){
  14.         manufacturer = "XXX";
  15.         type = "YYY";
  16.         seat = 1;
  17.     }
  18.     Vehicle(string ma,string ty,int se){
  19.         manufacturer = ma;
  20.         type = ty;
  21.         seat = se;
  22.     }
  23.     void setManufacturer(string ma){
  24.         manufacturer = ma;
  25.     }
  26.     string getManufacturer(){
  27.         return manufacturer;
  28.     }
  29.     void setType(string ty){
  30.         type = ty;
  31.     }
  32.     string getType(){
  33.         return type;
  34.     }
  35.     void setSeat(int se){
  36.         seat = se;
  37.     }
  38.     int getSeat(){
  39.         return seat;
  40.     }
  41.     void display(){
  42.         cout<<"Manufacturer: "<< manufacturer <<endl
  43.         <<"Type: "<< type << endl
  44.         <<"Seat Number: " << seat <<endl;
  45.     }
  46. };
  47.  
  48. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement