Advertisement
Timtsa

car header

Jan 30th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.13 KB | None | 0 0
  1. #pragma once
  2. #include <iostream>
  3. #include <string>
  4. using namespace std;
  5. class RandomGenerator
  6. {
  7. public:
  8.     void SetProability(int p)
  9.     {
  10.         probility = p;
  11.     }
  12.  
  13.  
  14.     bool GetEvent()
  15.     {
  16.         int check = rand() % 60;
  17.         if (check<=probility)
  18.         {
  19.             return true;
  20.         }
  21.         return false;
  22.     }
  23.  
  24.  
  25. private:
  26.     int probility = 0;
  27.    
  28. };
  29.  
  30. class Car
  31. {
  32.     string description;
  33.     int arrivedTime;
  34.  
  35. public:
  36.  
  37.     Car(string _description,int time)
  38.     {
  39.         description = _description;
  40.         arrivedTime = time;
  41.     }
  42.  
  43.     Car(string _description)
  44.     {
  45.         description = _description;
  46.         arrivedTime = 0;
  47.     }
  48.  
  49.     string getDescription()
  50.     {
  51.         return description;
  52.     }
  53.     int getarrivedTime()
  54.     {
  55.         return arrivedTime;
  56.     }
  57.     void ShoeCar()
  58.     {
  59.         cout << description << endl;
  60.     }
  61. };
  62.  
  63.  
  64.  
  65. class CarMaker
  66. {
  67.     string CarState[4]{ "novii","crash","pumped","sported" };
  68.     string CarMarck[5]{ " Djiguli "," BMW "," Mersedes "," JEEP "," Volvo " };
  69.     string CarColr[4]{ " Green"," Red"," Pink"," Blac" };
  70. public:
  71.     Car MakeCar()
  72.     {
  73.         string description = CarState[rand() % 4] + CarMarck[rand() % 5] + CarColr[rand() % 4];
  74.  
  75.         Car b(description);
  76.         return b;
  77.  
  78.     }
  79.    
  80.  
  81.  
  82. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement