Website Summary Files Commits Branches @commit @diff @stats
path: root / Week10 / Exercise02 / CombustionVehicle.h
diff options
context:
space:
mode:
1 files changed, 27 insertions, 0 deletions
-rw-r--r--Week10/Exercise02/CombustionVehicle.h27
diff --git a/Week10/Exercise02/CombustionVehicle.h b/Week10/Exercise02/CombustionVehicle.h
new file mode 100644
index 0000000..7c102be
--- /dev/null
+++ b/Week10/Exercise02/CombustionVehicle.h
@@ -0,0 +1,27 @@
+#ifndef _COMBUSTIONVEHICLE
+#define _COMBUSTIONVEHICLE
+
+#include "Vehicle.h"
+#include <istream>
+#include <ostream>
+
+class CombustionVehicle : public Vehicle {
+ unsigned cyllindersCount;
+ double engineVolume;
+
+public:
+ CombustionVehicle();
+
+ unsigned GetCyllindersCount() const;
+ void SetCyllindersCount(unsigned cyllindersCount);
+
+ double GetEngineVolume() const;
+ void SetEngineVolume(double engineVolume);
+
+ friend std::ostream& operator<<(std::ostream& ostr, const CombustionVehicle& vehicle);
+ friend std::istream& operator>>(std::istream& istr, CombustionVehicle& vehicle);
+
+ static bool IsCombustionVehicle(const Vehicle& vehicle);
+};
+
+#endif /* _COMBUSTIONVEHICLE */