Website Summary Files Commits Branches @commit @diff @stats
path: root / Week10 / Exercise02 / CombustionVehicle.h
diff options
context:
space:
mode:
Commit7546f0d0da487e16f0a8671c09a46e1cee2bc03a (patch)
Author
 Syndamia <kamen@syndamia.com>
2026-05-02 14:57:36 +0300
Committer
 Syndamia <kamen@syndamia.com>
2026-05-02 14:57:36 +0300
Files6462868cebe114a87ca38252af9a49bce6603286 /Week10/Exercise02/CombustionVehicle.h
oop-2025-solutions-7546f0d0da487e16f0a8671c09a46e1cee2bc03a.tar
oop-2025-solutions-7546f0d0da487e16f0a8671c09a46e1cee2bc03a.tar.gz
oop-2025-solutions-7546f0d0da487e16f0a8671c09a46e1cee2bc03a.zip
Parentc98c633b7087e3c52f4b05236f3509a9ec5f2bba (diff)
feat(Week10): Add solutions
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 */