subject

Btw: this is not a middle school question, it is college.

assume the existence of a building class. define a derived class, apartmentbuilding that contains four (4) data members: an integer named numfloors, an integer named unitsperfloor, a boolean named haselevator, and a boolean named hascentralair. there is a constructor containing parameters for the initialization of the above variables (in the same order as they appear above). there are also two functions: the first, gettotalunits, accepts no parameters and returns the total number of units in the building; the second, isluxurybuilding accepts no parameters and returns true if the building has central air, an elevator and 2 or less units per floor.

the solution i have tried is:
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;
}

this, however, does not work! i get an error stating: "in file included from ctest. cpp: 32: 0:
c. h: 1: 108: error: declaration of ‘apartmentbuilding: : apartmentbuilding(int, int, bool, bool)’ outside of class is not definition [-fpermissive]
apartmentbuilding: : apartmentbuilding(int numfloors, int unitsperfloor, bool haselevator, bool hascentralair); "

i don't understand question is from myprogramminglab.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 17:30
The forerunner to cell phones, pdas, and smartphones was
Answers: 1
question
Computers and Technology, 23.06.2019 10:00
Install and use wireshark program ( send back screen shots and other vital information) case project 3-2: decode a tcp segment in a wireshark capture in this chapter, you walked through tcp segment to interpret the data included in its header. in this project, you use wireshark to capture your own http messafes, examine the tcp headers, and practice interpreting the data you'll find there. 1. open wireshark and snap the window to one side of your screen. open a browser and snap that window to the other side of your screen so you can see both windows.
Answers: 2
question
Computers and Technology, 23.06.2019 12:00
Which of these is an example of an integrated presentation? a. a table created in powerpoint b. an image pasted into powerpoint c. a caption created in powerpoint d. an excel chart pasted into powerpoint
Answers: 1
question
Computers and Technology, 23.06.2019 19:30
What are loans to a company or government for a set amount of time
Answers: 1
You know the right answer?
Btw: this is not a middle school question, it is college.

assume the existence of a buil...
Questions
question
Mathematics, 23.09.2021 14:00
question
Mathematics, 23.09.2021 14:00
question
Mathematics, 23.09.2021 14:00
question
Physics, 23.09.2021 14:00
question
Spanish, 23.09.2021 14:00
question
Mathematics, 23.09.2021 14:00
Questions on the website: 13722363