Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Students also viewed these Databases questions

Question

How do Data Types perform data validation?

Answered: 1 week ago

Question

How does Referential Integrity work?

Answered: 1 week ago