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/ElectricVehicle.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Week10/Exercise02/ElectricVehicle.h (limited to 'Week10/Exercise02/ElectricVehicle.h') diff --git a/Week10/Exercise02/ElectricVehicle.h b/Week10/Exercise02/ElectricVehicle.h new file mode 100644 index 0000000..5a48b27 --- /dev/null +++ b/Week10/Exercise02/ElectricVehicle.h @@ -0,0 +1,31 @@ +#ifndef _ELECTRICVEHICLE +#define _ELECTRICVEHICLE + +#include "Vehicle.h" +#include +#include + +class ElectricVehicle : public Vehicle { + double batteryCapacity; + double range; + double chargingCapacity; + +public: + ElectricVehicle(); + + double GetBatteryCapacity() const; + void SetBatteryCapacity(double batteryCapacity); + + double GetRange() const; + void SetRange(double range); + + double GetCharingCapacity() const; + void SetChargingCapacity(double chargingCapacity); + + friend std::ostream& operator<<(std::ostream& ostr, const ElectricVehicle& vehicle); + friend std::istream& operator>>(std::istream& istr, ElectricVehicle& vehicle); + + static bool IsElectricVehicle(const Vehicle& vehicle); +}; + +#endif /* _ELECTRICVEHICLE */ -- cgit v1.3.1-26-gb76a