Summary Files Commits Branches @commit @diff @stats
path: root / Year 1 / Object-oriented Programming / Exam 2 / ex2 / Event.cpp
diff options
context:
space:
mode:
Commita82a54f081ce561e6bc6e9f82869f8b40a47e660 (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-25 19:59:16 +0300
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-25 19:59:16 +0300
Filesa0cf9fc2e5f954456bdec52db780e1778c9808e6 /Year 1/Object-oriented Programming/Exam 2/ex2/Event.cpp
uni-projects-a82a54f081ce561e6bc6e9f82869f8b40a47e660.tar
uni-projects-a82a54f081ce561e6bc6e9f82869f8b40a47e660.tar.gz
uni-projects-a82a54f081ce561e6bc6e9f82869f8b40a47e660.zip
Parent71c57cde42e99301aeb079be4ef368ff155f99c5 (diff)
Added my work from today's exam
1 files changed, 18 insertions, 0 deletions
-rw-r--r--Year 1/Object-oriented Programming/Exam 2/ex2/Event.cpp18
diff --git a/Year 1/Object-oriented Programming/Exam 2/ex2/Event.cpp b/Year 1/Object-oriented Programming/Exam 2/ex2/Event.cpp
new file mode 100644
index 0000000..90c3740
--- /dev/null
+++ b/Year 1/Object-oriented Programming/Exam 2/ex2/Event.cpp
@@ -0,0 +1,18 @@
+#include "Event.h"
+
+void Event::setStartTime(unsigned startTime) {
+ this->startTime = startTime;
+}
+
+void Event::setEndTime(unsigned endTime) {
+ this->endTime = endTime;
+}
+
+Event::Event(unsigned startTime, unsigned endTime) {
+ setStartTime(startTime);
+ setEndTime(endTime);
+}
+
+bool Event::isHappeningAt(unsigned time) const {
+ return time >= startTime && time <= endTime;
+}