Advertisement
Guest User

Untitled

a guest
Jan 17th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.93 KB | None | 0 0
  1. #include <iostream>
  2. #include "iostream"
  3. #include "stdio.h"
  4. #include "math.h"
  5. #include "iomanip"
  6. #include "string.h"
  7. #include <stdio.h>
  8.  
  9. #include <conio.h>
  10.  
  11. using namespace std;
  12.  
  13. class Car {
  14. private:
  15.     int color, speed, weels;
  16. public:
  17.     Car(){
  18.         color = 1;
  19.         speed = 135;
  20.         weels = 4;
  21.         get();
  22.     }
  23.  
  24.      void set (int color1, int speed1, int weels1){
  25.         color = color1;
  26.         speed = speed1;
  27.         weels = weels1;
  28.     }
  29.    
  30.     void get (){
  31.         cout << "Color is "<< color <<" | "<< "Speed is "<< speed <<" | "<<"Weels is " <<weels<<endl;
  32.  
  33.     }
  34. protected:
  35.     int proizvoditel;
  36. };
  37.  
  38. class Story : private Car {
  39.     public:
  40.     Story(int p){
  41.         proizvoditel = p;
  42.          cout << "proizvoditel - "<< proizvoditel<< endl;
  43.     }
  44.  
  45. };
  46.  
  47. int main()
  48. {
  49.     Car G1;
  50.     G1.set(2, 150, 4);
  51.     G1.get();
  52.    
  53.     Story p(111);
  54.    
  55.     return 0;
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement