-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDomain.cpp
More file actions
83 lines (65 loc) · 2.08 KB
/
Domain.cpp
File metadata and controls
83 lines (65 loc) · 2.08 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
#include "Domain.h"
//constructor for electric auto
Domain::Elektroauto::Elektroauto(string brand, string model, int year_of_registration, float price, float loading_time,
float range) {
this->id = count;
this->brand = brand;
this->model = model;
this->year_of_registration = year_of_registration;
this->kilometer = 0;
this->price = price;
this->loading_time = loading_time;
this->range = range;
count++;
}
//setters and getters
int Domain::Elektroauto::getId() const {
return this->id;
}
string Domain::Elektroauto::getBrand() const {
return this->brand;
}
void Domain::Elektroauto::setBrand(string brand) {
this->brand = brand;
}
string Domain::Elektroauto::getModel() const {
return this->model;
}
void Domain::Elektroauto::setModel(string model) {
this->model = model;
}
int Domain::Elektroauto::getYearOfRegistration() const {
return this->year_of_registration;
}
void Domain::Elektroauto::setYearOfRegistration(int yearOfRegistration) {
this->year_of_registration = yearOfRegistration;
}
float Domain::Elektroauto::getKilometer() const {
return this->kilometer;
}
void Domain::Elektroauto::setKilometer(float kilometer) {
this->kilometer = kilometer;
}
float Domain::Elektroauto::getPrice() const {
return this->price;
}
void Domain::Elektroauto::setPrice(float price) {
this->price = price;
}
float Domain::Elektroauto::getLoadingTime() const {
return this->loading_time;
}
void Domain::Elektroauto::setLoadingTime(float loadingTime) {
this->loading_time = loadingTime;
}
float Domain::Elektroauto::getRange() const {
return this->range;
}
void Domain::Elektroauto::setRange(float range) {
this->range = range;
}
void Domain::Elektroauto::print_car() {
cout << "(" << "Id:"<<this->id<<" Brand:" << this->brand << ", Model:" << this->model << ", Year of Registration:"
<< this->year_of_registration << ", Kilometer:" << this->kilometer << ", Price:" << this->price
<< ", Loading time:" << this->loading_time << ", Range:" << this->range << ")" << endl;
}