-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFactory.cpp
More file actions
44 lines (35 loc) · 992 Bytes
/
Factory.cpp
File metadata and controls
44 lines (35 loc) · 992 Bytes
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
#include "Factory.h"
void Factory::setName(string* name) {
if (name == NULL) {
return;
}
if (this->name != NULL) {
delete this->name;
}
this->name = new string(*(name));
}
void Factory::setWorkersCount(int workersCount) {
this->workersCount = workersCount;
}
void Factory::setWorkerEfficienty(double workerEfficiency) {
this->workerEfficienñy = workerEfficiency;
}
string* Factory::getName() {
string* result = new string(*(this->name));
return result;
}
int Factory::getWorkersCount() {
return workersCount;
}
double Factory::getWorkerEfficiency() {
return workerEfficienñy;
}
void Factory::print() {
cout << "Íàçâàíèå çàâîäà: " << *(this->name) << endl;
cout << "Êîëè÷åñòâî ðàáîòíèêîâ çàâîäà: " << this->workersCount << endl;
cout << "Åæåäíåâíàÿ ýôôåêòèâíîñòü îäíîãî ðàáî÷åãî: " << this->workerEfficienñy << endl;
}
double Factory::getFactoryOutput() {
double output = workerEfficienñy * workersCount;
return output;
}