School Commit Init

This commit is contained in:
2024-08-31 12:07:21 +03:00
commit 0b130ee18c
2801 changed files with 4720552 additions and 0 deletions
@@ -0,0 +1,19 @@
#include "block.h"
Block::Block(int constructionYear, int totalApartments, int occupiedApartments){
this->constructionYear = constructionYear;
this->totalApartments = totalApartments;
this->occupiedApartments = occupiedApartments;
}
bool Block::mustBeRestored(){
return (this->constructionYear < 1987) && (this->occupiedApartments/this->totalApartments>0.8);
}
bool Block::canBeDemolished(){
return (this->occupiedApartments/this->totalApartments<0.05);
}
std::string Block::toString(){
return "Block built in: " + std::to_string(this->constructionYear) + " with " + std::to_string(this->totalApartments) + " apartments, of which " + std::to_string(this->occupiedApartments) + " are occupied.";
}