Once display_capacity
is defined in the railroad_car
,
box_car
, and tank_car
classes, you can add it to the
for
loop:
// Display classes using display_short_name virtual function:
for (n = 0; n < car_count; ++n) {
train[n] -> display_short_name ( );
cout << " ";
train[n] -> display_capacity ( );
cout << endl;
}