Home Segments Top Top Previous Next

270: Practice

Create a class, TankCar, for tank cars, patterned on the BoxCar class that you were asked to define in Segment 231. Include instance variables for the length and radius of each car. Include a volume instance method that makes use of the instance variables in the TankCar class.