Summary Files Commits Branches @commit @diff @stats
path: root / Year 1 / Object-oriented Programming / Exam 2 Preparation / Vehicle.h
diff options
context:
space:
mode:
1 files changed, 21 insertions, 0 deletions
-rw-r--r--Year 1/Object-oriented Programming/Exam 2 Preparation/Vehicle.h21
diff --git a/Year 1/Object-oriented Programming/Exam 2 Preparation/Vehicle.h b/Year 1/Object-oriented Programming/Exam 2 Preparation/Vehicle.h
new file mode 100644
index 0000000..d052162
--- /dev/null
+++ b/Year 1/Object-oriented Programming/Exam 2 Preparation/Vehicle.h
@@ -0,0 +1,21 @@
+#ifndef HEADER_VEHICLE
+#define HEADER_VEHICLE
+
+#include "String.h"
+#include "Road.h"
+
+class Vehicle {
+ String brand;
+ unsigned maxSpeed;
+
+public:
+ Vehicle(const String& brand, unsigned maxSpeed);
+
+ unsigned getMaxSpeed() const;
+ virtual unsigned getSpeedOnRoad(Road road) const = 0;
+
+ virtual Vehicle* clone() const = 0;
+ virtual ~Vehicle();
+};
+
+#endif