-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
117 lines (78 loc) · 3.83 KB
/
Copy pathmain.cpp
File metadata and controls
117 lines (78 loc) · 3.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#include "DrugFactory.h"
#include "Utils.h"
#include <iostream>
using namespace std;
#define MIN_WORKERS_COUNT 1
#define MAX_WORKERS_COUNT 10000
#define MIN_WORKERS_EFFICIENCY 0.5
#define MAX_WORKERS_EFFICIENCY 5.0
#define MIN_CONVEYOR_SPEED 0.5
#define MAX_CONVEYOR_SPEED 10.0
#define MIN_CONVEYOR_LENGTH 5.0
#define MAX_CONVEYOR_LENGTH 50.0
#define MIN_NUM_OF_TANKS 1
#define MAX_NUM_OF_TANKS 10
#define MIN_TANK_CAPACITY 0.5
#define MAX_TANK_CAPACITY 10.0
#define MIN_DRUG_DOSAGE 1
#define MAX_DRUG_DOSAGE 100
int main() {
setlocale(LC_ALL, "Russian");
Utils* util = new Utils();
cout << "1) Введите название завода" << endl;
string factoryName = util->inputString();
cout << "2) Введите количество работников завода" << endl;
int workersCount = util->inputInteger(MIN_WORKERS_COUNT, MAX_WORKERS_COUNT);
cout << "3) Введите ежедневную эффективность рабочего (в кол-ве производимых продуктов)" << endl;
double workerEfficiency = util->inputDouble(MIN_WORKERS_EFFICIENCY, MAX_WORKERS_EFFICIENCY);
cout << "4) Введите скорость конвейера (в м/с)" << endl;
double conveyorSpeed = util->inputDouble(MIN_CONVEYOR_SPEED, MAX_CONVEYOR_SPEED);
cout << "5) Введите длину конвейера (в м)" << endl;
double conveyorLength = util->inputDouble(MIN_CONVEYOR_LENGTH, MAX_CONVEYOR_LENGTH);
cout << "6) Введите количество чанов с химикатами" << endl;
int numOfTanks = util->inputInteger(MIN_NUM_OF_TANKS, MAX_NUM_OF_TANKS);
cout << "7) Введите объём одного чана с химикатами (в м^3)" << endl;
double tankCapacity = util->inputDouble(MIN_TANK_CAPACITY, MAX_TANK_CAPACITY);
cout << "8) Введите название производимого препарата" << endl;
string drugName = util->inputString();
cout << "9) Введите количество препарата в 1 пачке (в мг)" << endl;
int drugDosage = util->inputInteger(MIN_DRUG_DOSAGE, MAX_DRUG_DOSAGE);
DrugFactory* drugFactory = new DrugFactory(&factoryName, workersCount, workerEfficiency,
conveyorSpeed, conveyorLength, numOfTanks, tankCapacity, &drugName, drugDosage);
cout << "Enter any key to continue...";
cin.get();
drugFactory->print(); // метод класса Factory
cout << "Enter any key to continue...";
cin.get();
drugFactory->launchConveyor(); // не написан
cout << "Enter any key to continue...";
cin.get();
drugFactory->stopConveyor(); // не написан
cout << "Enter any key to continue...";
cin.get();
drugFactory->fillTanks();
cout << "Enter any key to continue...";
cin.get();
drugFactory->emptyTanks();
cout << "Enter any key to continue...";
cin.get();
drugFactory->researchDrugs(); // не написан
cout << "Enter any key to continue...";
cin.get();
drugFactory->testDrugs(); // не написан
cout << "Enter any key to continue...";
cin.get();
cout << "Завод может производить " << drugFactory->Factory::getFactoryOutput()
<< " лекарств" << endl;
cout << "Завод может производить " << drugFactory->ConveyoredFactory::getFactoryOutput()
<< " лекарств с помощью конвейера" << endl;
cout << "Завод может производить " << drugFactory->ChemicalFactory::getFactoryOutput()
<< " лекарств с помощью чанов с химикатами" << endl;
cout << "Enter any key to continue...";
cin.get();
delete drugFactory;
cout << "Вот и все, зачетно?" << endl;
cout << "Enter any key to continue..." << endl;
cin.get();
return 0;
}