Question: The code below is a Cone.java class. This class will ask the elements and calculate the volume or surface area. Create a function of type

The code below is a Cone.java class. This class will ask the elements and calculate the volume or surface area.

Create a function of type Cone that calculates the volume and create another function of type Cone that calculates the surface area.

Example: public Cone Volume(Cone other)

{

//Code here

}

With that, create a main for the program to run

Cone.java

---------------------------------------------------------

package edu.pupr.shapes;

import java.util.Scanner;

public class Cone {

private double Height; private double Radius; public Cone() { Height = 0.0; Radius = 0.0; } public Cone(double height, double radius) { Height = height; Radius = radius; } public double getHeight() { return Height; } public void setHeight(double height) { Height = height; } public double getRadius() { return Radius; } public void setRadius(double radius) { Radius = radius; } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!