-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCab.cpp
More file actions
66 lines (57 loc) · 1.02 KB
/
Cab.cpp
File metadata and controls
66 lines (57 loc) · 1.02 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
//
// Created by moran on 03/12/16.
//
#include "Cab.h"
/**
* constractor.
* @param id cab id.
* @param km number of km.
* @param cabType cab type.
* @param color color of cab.
* @return
*/
Cab::Cab(int id, double km, enum CarType cabType, enum Color color){
cabId=id;
numOfKm=km;
carType=cabType;
cabColor=color;
}
/**
* get cab id.
* @return cab id.
*/
int Cab::getCabId(){
return this->cabId;
}
/**
* get number of km of cab.
* @return number of km of cab.
*/
double Cab::getNumOfKm(){
return this->numOfKm;
}
/**
* get car type.
* @return car type.
*/
CarType Cab::getCarType(){
return this->carType;
}
/**
* get color of cab.
* @return color of cab.
*/
Color Cab::getColor(){
return this->cabColor;
}
/**
* destructor.
*/
Cab::~Cab(){
}
bool operator==(Cab cab1, Cab cab2){
return cab1.getCabId() == cab2.getCabId()&&
cab1.getNumOfKm() == cab2.getNumOfKm()&&
cab1.getCarType()==cab2.getCarType() &&
cab1.getColor() == cab2.getColor();
}