forked from zhanggiene/CZ4031
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRecord.cpp
51 lines (40 loc) · 1.17 KB
/
Record.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
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
class Record {
private:
string tconst;
double averageRating;
int numVotes;
public:
static const int RECORD_SIZE = 22; //10+8+4
Record(string tconst, double averageRating, int numVotes){
this->tconst = tconst;
this->averageRating = averageRating;
this->numVotes = numVotes;
}
void setTconst(string tconst){
this->tconst = tconst;
}
void setAverageRating(double averageRating){
this->averageRating = averageRating;
}
void setNumVotes(int numVotes){
this->numVotes = numVotes;
}
string getTconst(){
return this->tconst;
}
double getAverageRating(){
return this->averageRating;
}
int getNumVotes(){
return this->numVotes;
}
string toString(){
ostringstream out;
out << this->tconst << "\t" << this->averageRating << "\t" << this->numVotes<<"\n";
return out.str();
}
};