A. Writing an Interface In this problem you will first write an interface and then modify classes to implement the interface. Write an interface, GeometricSolid, which has one method, volume. The volume method takes no arguments and returns a double. You are provided with three classes: Cylinder, Sphere, and RightCircularCone Modify the classes so that they implement the GeometricSolid interface. Supply the appropriate method for each class. You can use Google search to find the formula for the volume. Make sure that you use Math.PI in your calculations. Notice in InterfaceRunner that the objects are added to an ArrayList of GeometricSolids. since I couldn't fit all images with two screen shots I left the link here link: https://codecheck.it/files/18040616319p6jy6gzkdzuq08nmlp81251t
A. Writing an Interface
In this problem you will first write an interface and then modify classes to implement the interface. Write an interface, GeometricSolid, which has one method, volume. The volume method takes no arguments and returns a double.
You are provided with three classes: Cylinder, Sphere, and RightCircularCone Modify the classes so that they implement the GeometricSolid interface. Supply the appropriate method for each class. You can use Google search to find the formula for the volume. Make sure that you use Math.PI in your calculations.
Notice in InterfaceRunner that the objects are added to an ArrayList of GeometricSolids.
since I couldn't fit all images with two screen shots I left the link here
link: https://codecheck.it/files/18040616319p6jy6gzkdzuq08nmlp81251t
Trending now
This is a popular solution!
Step by step
Solved in 7 steps with 2 images