Home Segments Index Top Previous Next

249: Practice

Create a class, liquid_gas_car, for cars that carry liquid gas. Assume that the cars carry the gas in two or three identical spheres. Include a member variable for the number and radius of the spheres, along with appropriate constructor member functions. Also include a volume member function that makes use of the member variables and the volume function in the sphere class.