Summary Files Commits Branches @commit @diff @stats
path: root / Year 1 / Object-oriented Programming / Exam 2 / ex1 / CarTravel.cpp
diff options
context:
space:
mode:
1 files changed, 22 insertions, 0 deletions
-rw-r--r--Year 1/Object-oriented Programming/Exam 2/ex1/CarTravel.cpp22
diff --git a/Year 1/Object-oriented Programming/Exam 2/ex1/CarTravel.cpp b/Year 1/Object-oriented Programming/Exam 2/ex1/CarTravel.cpp
new file mode 100644
index 0000000..6632f00
--- /dev/null
+++ b/Year 1/Object-oriented Programming/Exam 2/ex1/CarTravel.cpp
@@ -0,0 +1,22 @@
+#include "CarTravel.h"
+
+CarTravel::CarTravel() : CarTravel(RegNumb(), 0, 0) {}
+
+CarTravel::CarTravel(RegNumb regNumber, unsigned distance, unsigned duration) {
+ this->regNumb = regNumber;
+ this->distance = distance;
+ this->duration = duration;
+}
+
+RegNumb CarTravel::getRegNumb() const {
+ return regNumb;
+}
+
+unsigned CarTravel::getDistance() const {
+ return distance;
+}
+
+unsigned CarTravel::getDuration() const {
+ return duration;
+}
+