Skip to main content

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

Back to lesson: Practice: Inheritance mechanics