Website Summary Files Commits Branches @commit @diff @stats
path: root / Sem. 06 / Event / Date.h
diff options
context:
space:
mode:
Commitd3c133e918cb85933c961c31871d038cace6b638 (patch)
Author
 Angel Dimitriev <achi_d@abv.bg>
2022-03-29 20:00:49 +0300
Committer
 GitHub <noreply@github.com>
2022-03-29 20:00:49 +0300
Files200177f14d906fe71e7745aec9799c4c0b11171f /Sem. 06/Event/Date.h
Object-oriented_programming_FMI-d3c133e918cb85933c961c31871d038cace6b638.tar
Object-oriented_programming_FMI-d3c133e918cb85933c961c31871d038cace6b638.tar.gz
Object-oriented_programming_FMI-d3c133e918cb85933c961c31871d038cace6b638.zip
Parent4b875f477c0eaa55ee1ea81949af6c6010249888 (diff)
Add files via upload
1 files changed, 33 insertions, 0 deletions
-rw-r--r--Sem. 06/Event/Date.h33
diff --git a/Sem. 06/Event/Date.h b/Sem. 06/Event/Date.h
new file mode 100644
index 0000000..8c2f085
--- /dev/null
+++ b/Sem. 06/Event/Date.h
@@ -0,0 +1,33 @@
+#pragma once
+
+class Date
+{
+ size_t day;
+ size_t month;
+ size_t year;
+
+ size_t MAX_DAYS[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
+
+ mutable int dayOfWeek; //allowing to be changed by constant objects
+ mutable bool isModified = true;
+
+ bool isLeapYear() const;
+public:
+ Date(size_t day, size_t month, size_t year);
+
+ size_t getDay() const;
+ size_t getMonth() const;
+ size_t getYear() const;
+
+ void setDay(size_t);
+ void setMonth(size_t);
+ void setYear(size_t);
+
+ void print() const;
+ void goToNextDay();
+
+ bool areEqual(const Date& other) const;
+
+ int getDayOfWeek(); //cant be const, because of changings dayOfWeek and isModified
+ // can we get around this ??
+}; \ No newline at end of file