C++ multiple choice. Which of the following is correct to declare class B to be a base class for derived class D? a. class D: public B b. class B: public D c. public base class B: class D d. class D extends B Solution Here option a.class D:public B Is the write answer Here option a.class D:public B Is the write answer The following example shows the class Circle that inherits \"publicly\" from the base class Form: class Form { private: double area; public: int color; double getArea(){ return this->area; } void setArea(double area){ this->area = area; } }; class Circle : public Form { public: double getRatio() { double a; a = getArea(); return sqrt(a / 2 * 3.14); } void setRatio(double diameter) { setArea( pow(diameter * 0.5, 2) * 3.14 ); } bool isDark() { return (color > 10); } }; The new class Circle inherits the attribute area from the base class Form (the attribute area is implicitly an attribute of the class Circle), but it cannot access it directly. It does so through the functions getArea and setArea (that are public in the base class and remain public in the derived class). .