-
Notifications
You must be signed in to change notification settings - Fork 0
/
Date.hpp
41 lines (40 loc) · 841 Bytes
/
Date.hpp
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
#ifndef __DATE_HPP__
#define __DATE_HPP__
#include <string>
class Date{
private:
int day;
int month;
int year;
public:
Date() {
month = day = year = 0;
}
Date(int m, int d, int y){
month = m;
day = d;
year = y;
}
void setDay(int d){
day = d;
}
void setMonth(int m){
month = m;
}
void setYear(int y){
year = y;
}
int getDay(){
return day;
}
int getMonth(){
return month;
}
int getYear(){
return year;
}
std::string toString(){
return std::to_string(month) + "/" + std::to_string(day) + "/" + std::to_string(year);
}
};
#endif