Design and implement a Java class to represent a 3-D geometric shape of your choice. The class should contain a constructor, appropriate data fields and methods to return the volume of the shape, and the surface area of the shape and any other methods that seem to make sense for you shape. And, create a Java Test Application to construct your shape and demonstrate the successful call to its methods.

Please, include notes in the code.

Solution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

public class Tester {
public static void main(String args[])
Sphere sphere = new Sphere(10.0);
System.out.println("Sphere radius: " + sphere.getRadius() + ", Sphere surface area: " + sphere.getSurfaceArea() + ", Sphere volume: " + sphere.getVolume());...

This is only a preview of the solution. Please use the purchase button to see the entire solution


or free if you
register a new account!

Related Homework Solutions

Get help from a qualified tutor
Live Chats