From 7546f0d0da487e16f0a8671c09a46e1cee2bc03a Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sat, 2 May 2026 14:57:36 +0300 Subject: feat(Week10): Add solutions --- Week10/Exercise02/CombustionVehicle.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Week10/Exercise02/CombustionVehicle.h (limited to 'Week10/Exercise02/CombustionVehicle.h') 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 +#include + +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 */ -- cgit v1.3.1-26-gb76a