Practice ยท 1 of 3
Base and derived chain
Implement class Vehicle with a constructor Vehicle(int wheels) and int wheels() const (private int wheels_;), and class Bicycle : public Vehicle with a constructor Bicycle() that passes 2 to the base and adds nothing else.
Difficulty: intermediate
Press Submit to check your solution.
Back to lesson: Practice: Inheritance mechanics