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