Answer:
class ApartmentBuilding: public Building
{
private:
int numFloors;
int unitsPerFloor;
bool hasElevator;
bool hasCentralAir;
public:
ApartmentBuilding(int x,int y, bool b, bool c){numFloors=x; unitsPerFloor=y; hasElevator=b; hasCentralAir=c;};
int getTotalUnits();
bool isLuxuryBuilding();
};
int ApartmentBuilding::getTotalUnits()
{ return numFloors*unitsPerFloor; }
bool ApartmentBuilding:: isLuxuryBuilding()
{
if(hasCentralAir==true && hasElevator == true && unitsPerFloor<=2)
return true;
else
return false;
}
Explanation:
In programming, it is essential to use the right form of command and avoid the use of unnecessary punctuation marks such as comma or space. In your code, most of the instructions are joined together and that is the reason why you are receiving an error message. The correct form of codes and arrangement is provided in the answer section.