Question

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

Related Homework Solutions

Monster Game in Java
Homework Solution
$14.00
Computer Science
Java Programming
Monster Game
Inheritance
Superclasses
Subclasses
Fighters
Monsters
Functions
Objects
Data
Stats
Random Dice Driver in Java
Homework Solution
$32.00
Computer Science
Java Programming
Random Dice Driver
Loops
Integers
Arrays
Zeros
Rolls
Algorithms
Java Programming Problems
Homework Solution
$40.00
Computer Science
Java Programming
Pac Man
Grid
Cells
Commands
Positions
Directions
Game Statistics
Cookies
Virtual Network of Routers in Java
Homework Solution
$30.00
Computer Science
Java Programming
Networking
Routing
Classes
Algorithms
Packets
Instances
LSP
Functions
Sequences
Infinity Values
Paths
Adjacency Matrix
Destinations
Java Programming Problems
Homework Solution
$55.00
Computer Science
Java Programming
Vehicles
Cars
Trucks
Inheritance
Global Variables
Mileage
Classes
Constructors
Methods
Boolean Parameters
Shapes
Path Planning in Java
Homework Solution
$60.00
Computer Science
Java Programming
Path Planning
Drones
Maps
Tower
Power
Batteries
Labels
Parameters
Objects
Get help from a qualified tutor
Live Chats