Computers and Technology
Computers and Technology, 18.11.2019 19:31, ernest214

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.

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 11:00, yentel110306
When building customer relationships through email what should you not do? question 2 options: utilize proper grammar, spelling, and punctuation type in all capital letters use hyperlinks rather than attachments respond to all emails within 24 hours
Answers: 1
image
Computers and Technology, 23.06.2019 09:00, vetterk1400
Design a class tictactoe that: holds the following information about the game: two-dimensional array (3 by 3), and winner. add additional variables as needed. includes the functions to perform the various operations on objects. for example, function to print the board, getting the move, checking if move is valid, determining if there is a winner after each move. add additional operations as needed. includes constructor(s). write the functions of the class, and write a program that uses the class. the program should declare an object of type tictactoe. the program will create the board and store it in the array. the program will allow two players to play the tic-tac-toe game. after every valid move update the array, check if there is a winner. if there is no winner and no tie, then print the board again to continue.
Answers: 2
image
Computers and Technology, 24.06.2019 01:00, kkruvc
Mastercard managers are motivated to increase (1) the number of individuals who have and use a mastercard credit card, (2) the number of banks and other clents who issue mastercards to customers and/or employees, and (3) the number of locations that accept mastercard payments. discuss how mastercard could use its data warehouse to it expand each of these customer bases.
Answers: 3
image
Computers and Technology, 24.06.2019 02:00, destinyd10189
Read the following scenario, and then answer the question below. you want to send an e-mail to your boss requesting a meeting to discuss a raise. what is the best example of an e-mail to an employer about this meeting? “hey jason. can we chat about getting me more money soon? let me know. peace, meg.” “hello jason. pardon me for sending yet another e-mail today about my need to talk to you about my position and a possible pay increase. i am dying to know when you can talk. sincerely, meg.” “hello jason. i have been with the company for one year and have taken on more responsibilities than outlined in my job description. i would appreciate an opportunity to speak with you about my position. let me know when we can schedule a meeting. you, meg.” “greetings jason! i hope this e-mail finds you well and happy today. i really, really want to talk to you about something important. i am not sure if you have time. i hope you do. get back in touch with me and let me know when we might talk. ever so much for taking the time to read this. sincerely, meg.”
Answers: 3
Do you know the correct answer?
Btw: this is not a middle school question, it is college.

assume the existence of a buil...

Questions in other subjects: