-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaxi.cpp
More file actions
88 lines (69 loc) · 1.95 KB
/
Taxi.cpp
File metadata and controls
88 lines (69 loc) · 1.95 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
#include "Taxi.h"
using namespace std;
//Constructor for Taxi with parameters.
Taxi::Taxi(int taxiId1, int numOfKilometers1, int tarrif1, color colorOfTaxi1,
manufacturer manufacturerOfTaxi1) {
taxiId = taxiId1;
numOfKilometers = numOfKilometers1;
tarrif = tarrif1;
colorOfTaxi = colorOfTaxi1;
manufacturerOfTaxi = manufacturerOfTaxi1;
}
//Constructor for Taxi with parameters.
Taxi::Taxi(int taxiId, char colorOfTaxi1, char manufacturerOfTaxi1) : taxiId(taxiId) {
taxiColor['R'] = RED;
taxiColor['B'] = BLUE;
taxiColor['G'] = GREEN;
taxiColor['P'] = PINK;
taxiColor['W'] = WHITE;
taxiManufacturer['H'] = HONDA;
taxiManufacturer['S'] = SUBARO;
taxiManufacturer['T'] = TESLA;
taxiManufacturer['F'] = FIAT;
colorOfTaxi = taxiColor[colorOfTaxi1];
manufacturerOfTaxi = taxiManufacturer[manufacturerOfTaxi1];
}
//Get taxi id.
int Taxi::getTaxiId() const {
return taxiId;
}
//Get the number of kilometers.
int Taxi::getNumOfKilometers() const {
return numOfKilometers;
}
//Get the tarrif.
int Taxi::getTarrif() const {
return tarrif;
}
//Get the color.
color Taxi::getColorOfTaxi() const {
return colorOfTaxi;
}
//Get the manufacture.
manufacturer Taxi::getManufacturerOfTaxi() const {
return manufacturerOfTaxi;
}
//Set the taxi id.
void Taxi::setTaxiId(int taxiId) {
Taxi::taxiId = taxiId;
}
//Set the number of kilometers.
void Taxi::setNumOfKilometers(int numOfKilometers) {
Taxi::numOfKilometers = numOfKilometers;
}
//Set the tarrif.
void Taxi::setTarrif(int tarrif) {
Taxi::tarrif = tarrif;
}
//Set the color.
void Taxi::setColorOfTaxi(color colorOfTaxi) {
Taxi::colorOfTaxi = colorOfTaxi;
}
//Set the manufacture.
void Taxi::setManufacturerOfTaxi(manufacturer manufacturerOfTaxi) {
Taxi::manufacturerOfTaxi = manufacturerOfTaxi;
}
//Add the number of kilometers.
void Taxi::addNumOfKilometers(int numOfKilometers) {
Taxi::numOfKilometers += numOfKilometers;
}