-
Notifications
You must be signed in to change notification settings - Fork 0
/
Date.h
51 lines (29 loc) · 1.1 KB
/
Date.h
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
//
// Created by Kavi Palmer on 1/4/22.
//
#ifndef SPORTSBETMANAGER_IMPROVED_DATE_H
#define SPORTSBETMANAGER_IMPROVED_DATE_H
#include <string>
class Date {
private:
int day, month, year; //variables denoting todays date
public:
Date(); //ctor
Date(int mon, int dy, int yr); //alt ctor
virtual std::string toString() const; //displays date as a string
virtual bool equals(const Date &rhs) const; //checks if rhs equals this Date object
void setDate(int mon, int dy, int yr); //sets the date
int getYear() const; //returns the year
int getMonth() const; //returns the month
int getDay() const; //returns the day
//operator overloads
bool operator<(const Date &rhs) const;
bool operator>(const Date &rhs) const;
bool operator==(const Date &rhs) const;
bool operator!=(const Date &rhs) const;
bool operator <=(const Date &rhs) const;
bool operator>=(const Date &rhs) const;
//used in looping, increments the date by one day, updating the month and year when appropriate
void increment();
};
#endif //SPORTSBETMANAGER_IMPROVED_DATE_H