-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrecord.cpp
More file actions
34 lines (29 loc) · 830 Bytes
/
record.cpp
File metadata and controls
34 lines (29 loc) · 830 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
#include "record.h"
Record::Record(std::string trainNumber, std::string startsite, std::string endsite, int seat, int price,float distance, time_t buytime) {
this->trainNumber = trainNumber;
this->startsite = startsite;
this->endsite = endsite;
this->seatNumber = seat;
this->price = price;
this->distance = distance;
this->buytime = buytime;
}
Record::~Record() {
}
std::string Record::getRecordStr() {
std::string res = "";
res += this->trainNumber;
res += "#";
res += this->startsite;
res += "#";
res += this->endsite;
res += "#";
res += std::to_string(this->seatNumber);
res += "#";
res += std::to_string(this->price);
res += "#";
res += std::to_string(this->distance);
res += "#";
res += std::to_string(this->buytime);
return res;
}