Let us take an example of private inheritance and inner class. Classes Car and Vehicle are related by private inheritance. Car also has an inner class/struct SpeedoMeter and a private instance of it.
class Vehicle {
public:
//..public interface and constructor
protected:
std::string color_;
std::string manufacturer_;
private:
int identifier_;
};
class Car : Vehicle {
public:
// ..public interface and constructor
void PrintInfo() {
/* ... access and print attributes
color_, numOfDoors etc..
*/
}
private:
struct SpeedoMeter {
// ... constructor ..
double mileage_;
};
SpeedoMeter speedoMeter_;
int numOfDoors_;
std::string model_;
};
The public method Car::PrintInfo is supposed to log all the properties of Car. Identify below all the properties or data members that are not accessible from method Car::PrintInfo: