Question: In Java Write a java program creating one interface called Geometry. In geometry create three methods each returning a double value. Call them: double cube
In Java
Write a java program creating one interface called Geometry. In geometry create three methods each returning a double value. Call them:
double cube (double L)
double sphere (double r)
double cone (double r, double height)
Implement the interface in two classes, one called Volume which calculates the volume of these geometries and one called Surface to calculate the surface area.
In main calculate the volumes and surface areas of each using 4.0 for r, L, Height.
Also calculate the surface area/ volume ratio for each. Verify that the sphere has the lowest surface area per volume ratio.
Hint: Use hand out program given last time called "InterfaceDemoVolume" as template
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
