1class Derived: public Base
2{
3public:
4 double m_cost;
5
6 Derived(double cost=0.0, int id=0)
7 : Base{ id }, // Call Base(int) constructor with value id!
8 m_cost{ cost }
9 {
10 }
11
12 double getCost() const { return m_cost; }
13};