Next define each of the derived classes: Flatcar, Boxcar, and Tanker.
In addition to the information in the Freightcar class, each of these has the
following.
- Flatcar: height, length (unsigned integers);
- Boxcar: height, length, width (unsigned integers), refrigerated (Boolean);
- Tanker: length, diameter (unsigned integers).
Also, for each, provide a constructor with parameters for each member variable, a
function for computing and returning the volume, and a function for printing. When
printing a Boxcar, print the road number and the volume surrounded by square brackets;
when printing a Flatcar, print the road number and the volume surrounded by underscores;
and when printing a Tankcar, print the road number and the volume surrounded by
parentheses.
Be careful to use virtual functions!