Skip to main content

Practice · 1 of 3

Base and derived chain

CHALLENGE
Difficulty: intermediate+25 XP

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.

Back to lesson: Practice: Inheritance mechanics