-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbusstop.cpp
73 lines (58 loc) · 1.24 KB
/
busstop.cpp
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
/*busstop.cpp*/
//
// A bus stop on the NU campus map.
//
#include <string>
#include <iostream>
#include <utility>
#include "busstop.h"
using namespace std;
//
// default constructor
//
BusStop::BusStop()
{}
//
// constructor
//
BusStop::BusStop(int stopid, int busroute, string stopname, string direction, string locationdesc, pair<double,double> position)
: StopID(stopid), BusRoute(busroute), StopName(stopname), Direction(direction), LocationDesc(locationdesc), Position(position)
{}
//
// print
//
void BusStop::print()
{
cout << this->StopID << ": bus " << this->BusRoute
<< ", " << this->StopName << ", " << this->Direction
<< ", " << this->LocationDesc << ", location ("
<< this->Position.first << ", " << this->Position.second << ')' << endl;
return;
}
//
// accessors
//
// stop id
int BusStop::getStopID() {
return this->StopID;
}
// bus route
int BusStop::getBusRoute() {
return this->BusRoute;
}
// stop name
string BusStop::getStopName() {
return this->StopName;
}
// direction
string BusStop::getDirection() {
return this->Direction;
}
// location
string BusStop::getLocationDesc() {
return this->LocationDesc;
}
// position
pair<double,double> BusStop::getPosition() {
return this->Position;
}