Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- #include <iostream>
- #include <string>
- using namespace std;
- class RandomGenerator
- {
- public:
- void SetProability(int p)
- {
- probility = p;
- }
- bool GetEvent()
- {
- int check = rand() % 60;
- if (check<=probility)
- {
- return true;
- }
- return false;
- }
- private:
- int probility = 0;
- };
- class Car
- {
- string description;
- int arrivedTime;
- public:
- Car(string _description,int time)
- {
- description = _description;
- arrivedTime = time;
- }
- Car(string _description)
- {
- description = _description;
- arrivedTime = 0;
- }
- string getDescription()
- {
- return description;
- }
- int getarrivedTime()
- {
- return arrivedTime;
- }
- void ShoeCar()
- {
- cout << description << endl;
- }
- };
- class CarMaker
- {
- string CarState[4]{ "novii","crash","pumped","sported" };
- string CarMarck[5]{ " Djiguli "," BMW "," Mersedes "," JEEP "," Volvo " };
- string CarColr[4]{ " Green"," Red"," Pink"," Blac" };
- public:
- Car MakeCar()
- {
- string description = CarState[rand() % 4] + CarMarck[rand() % 5] + CarColr[rand() % 4];
- Car b(description);
- return b;
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement