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, 21.06.2019 23:30
Step 1: choose your topics review the project milestone reflections you submitted for modules 1 through 4. choose the one major idea or concept from each module that you feel most applies to your life. in addition, choose an important concept from module 5 that applies to your life. step 2: write your guidebook for each module: write a catchy headline that clearly and concisely sums up your chosen idea or concept write a brief explanation that includes a description of the concept, why it is important, and how it can be applied to your life to make a positive impact choose an exciting, powerful, or engaging image that illustrates your concept remember, you are writing one for each module, so you will have a total of five headlines, five descriptions, and five images. step 3: design your guidebook choose a format to present your digital guidebook. there are many 21st century tools available for creating and submitting your work in the online environment. for more information on tools your school uses, contact your instructor or visit the web 2.0 tools area.
Answers: 3
question
Computers and Technology, 23.06.2019 01:30
Which tab is used to change the theme of a photo album slide show? a. design b. view c. transitions d. home
Answers: 1
question
Computers and Technology, 23.06.2019 08:30
Helen's credit card has an apr of 15.32% and a grace period of 17 days and helen pays her balance in the full every month. if her last billing cycle ended on september 26, 2009, and she made her payment on october 11, 2009, did she owe any interest on her last statement's balance?
Answers: 3
question
Computers and Technology, 24.06.2019 09:40
Healthy study habits are best described as
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, 25.02.2021 02:20
question
Mathematics, 25.02.2021 02:20
question
Mathematics, 25.02.2021 02:20
question
Mathematics, 25.02.2021 02:30
Questions on the website: 13722367