Inheritance Lab


  1. use this Circle class code
  2. Clean up the code so it compiles and runs for you
  3. Modify the program to include a derived class Cylinder
  4. Create a constructor for cylinder
  5. Create a calcval() method for cylinder
    Return the volume of the cylinder
    Note: volume is length * PI r2
  6. Undocument the code and test the cylinder
  7. Check your code using this
  8. Modify the program to include a derived class Sphere
  9. Create a constructor for sphere
  10. Create a calcval() method for sphere
    Return the volume of the sphere
    Note: volume is 4/3PI r3
  11. Create a main program to test your code
    Solution