School Commit Init
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
#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.";
|
||||
}
|
||||
Reference in New Issue
Block a user