Question: Whats wrong, if anything, with the following code? class Kitchen { private: double kit_sq_ft; public: Kitchen() {kit_sq_ft = 0.0; } virtual double area() const {

What’s wrong, if anything, with the following code?
class Kitchen
{
private:
double kit_sq_ft;
public:
Kitchen() {kit_sq_ft = 0.0; }
virtual double area() const { return kit_sq_ft * kit_sq_ft; }
};
class House : public Kitchen
{
private:
double all_sq_ft;
public:
House() {all_sq_ft += kit_sq_ft;}
double area(const char *s) const { cout << s; return all_sq_ft; }
};

Step by Step Solution

3.35 Rating (170 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

class House public Kitchen private double allsqft publ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Introduction Java Program Questions!