26 lines
710 B
C++
26 lines
710 B
C++
/// @file
|
|
/// @brief task B: Train class
|
|
|
|
#pragma once
|
|
|
|
#include "taskB.Device.hpp"
|
|
|
|
/// @todo Example class `Train` that publicly derives from 'Device'
|
|
struct Train : Device {
|
|
private:
|
|
std::string name_;
|
|
std::string description_;
|
|
size_t capacity_;
|
|
double length_;
|
|
|
|
public:
|
|
Train(std::string name, std::string description, size_t capacity, double length)
|
|
: name_(name), description_(description), capacity_(capacity), length_(length) {}
|
|
|
|
void print_info() const final override {
|
|
std::cout << name_ << ": " << description_ << std::endl;
|
|
std::cout << " length: " << length_ << " Meters" << std::endl;
|
|
std::cout << " capacity: " << capacity_ << " Passangers" << std::endl;
|
|
}
|
|
};
|