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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started