#include <iostream.h> 
const double pi = 3.14159;
class tank_car {
  public:
    double radius, length;
    tank_car ( ) {radius = 3.5; length = 40.0;}
    tank_car (double r, double l) {radius = r; length = l;}
    double read_radius ( ) {return radius;}
    void write_radius (double r) {radius = r;}
    double read_diameter ( ) {return radius * 2.0;}
    void write_diameter (double d) {radius = d / 2.0;}
    double read_length ( ) {return length;}
    void write_length (double l) {length = l;}
    double volume ( ) {return pi * radius * radius * length;}
};
main ( ) {
  tank_car t (3.5, 40.0);
  cout << "The volume of a tank car with radius = "
       << t.read_radius ( )
       << " and length = " << t.read_length ( )
       << " is " << t.volume ( ) << endl;
  t.write_radius (t.read_radius ( ) + 1);
  cout << "Increasing the radius by one yields a volume of "
       << t.volume ( ) << endl;
}
