26 lines
718 B
C++
26 lines
718 B
C++
/// @file
|
|
/// @brief task B: WashingMachine class
|
|
|
|
#pragma once
|
|
|
|
#include "taskB.Device.hpp"
|
|
|
|
/// @todo Example class `WashingMachine` that publicly derives from 'Device'
|
|
struct WashingMachine : Device {
|
|
private:
|
|
std::string name_;
|
|
std::string description_;
|
|
double price_;
|
|
double power_;
|
|
|
|
public:
|
|
WashingMachine(std::string name, std::string description, double price, double power)
|
|
: name_(name), description_(description), price_(price), power_(power) {}
|
|
|
|
void print_info() const final override {
|
|
std::cout << name_ << ": " << description_ << std::endl;
|
|
std::cout << " power: " << power_ << " Kilowatts" << std::endl;
|
|
std::cout << " price: " << price_ << " EUR" << std::endl;
|
|
}
|
|
};
|