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 18:30
Word vocabulary words: print, proofread, status line, graphics, font effects, left margin, justification, line spacing, copy/paste, data. review words: font point, bold, save, center, error. fill in the correct word for the definition and then transfer the letters to the appropriate spot by number. some numbers will be found multiple times. you will end up with a quotation about…… what else? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 k 16 17 18 19 20 21 22 23 24 25 8 27 28 29 w 31 32 k 34 35 36 w h 39 40 41 42 8 44 45 46 47 48 49 50 51 52 53 54 55 .1. a software function that records keystrokes on a disk or drive so information can be 5 4 52 9 later retrieved. p n 2. to produce a paper copy of information. 10 7 12u n 3. a display that shows the location of the cursor, pages, etc. 45 46 18 27 36 20 42p4. pictures or images, located in clip art or other files. 6 24 44 28 34 49 555. any mis-stroke of a key. 47 41 48 2 10 n6. allows major changes to the font such as shadow, emboss, etc. 21 25 46 35 23 21 29 14 22 17 n7. a feature that centers lines of text horizontally. 49 53 46 9 51 p8. size of the font 31 16 22 b l 9. a feature that prints designated text darker than the rest to add emphasis. 32 3 . p10. to compare copy on a display screen or printout to the original 24 39 25 23 54 9 50 3 and correct errors. j un 11. a feature that allows text to be aligned at the left 11 12 7 21 16 49 40 46 34 2 and right margins. leftn 12. amount of blank space on the left side of the paper. 8 18 41 6 34 linen 13. number of blank lines between lines of text. 17 4 49 13 1914. any information inputted into the computer. 3 4 46 44 p /p15. feature that duplicates text from one location and places it in another.
Answers: 2
question
Computers and Technology, 22.06.2019 22:30
Which of the following factors would your hypothetical supervisor look at when deciding whether to test a biological material sample for dna? the amount of other evidence you have implicating a suspect in a crime the annual budget for the crime lab both of the above none of the above; you would almost always order a test
Answers: 3
question
Computers and Technology, 24.06.2019 12:00
Jack is assisting his younger sibling mary with her mathematics assignment, which includes a study of the number system. jack explains to mary that whole numbers are counting numbers that could be used to record the number of fruits in a basket. which data type represents whole numbers? a.integers.b.floating-point numbers. c.strings.d.boolean
Answers: 1
question
Computers and Technology, 24.06.2019 13:30
What process should be followed while giving a reference? sam has given a reference of his previous manager in his resume. sam should him in advance that the potential employers will him.
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, 17.04.2021 04:20
question
Arts, 17.04.2021 04:20
Questions on the website: 13722367