Files
2024-08-31 12:07:21 +03:00

18 lines
479 B
C++

#include "house.h"
House::House(int constructionYear, bool isHistorical){
this->constructionYear = constructionYear;
this->isHistorical = isHistorical;
}
bool House::mustBeRestored(){
return (this->constructionYear < 1923);
}
bool House::canBeDemolished(){
return !this->isHistorical;
}
std::string House::toString(){
return "House built in: " + std::to_string(this->constructionYear) + " which is " + (this->isHistorical ? "" : "not ") + "historical.";
}