Question
h = V/(π * r * r)
C = 2πr(r + h)
Convert the resource code for this program to a class and develop a demo class to test the class.
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 Container{private double volume;
private double radius;
public Container() {
volume = 0.0;
radius = 0.0;
}
public void setVolume(double volume) {
this.volume = volume;
}
public double getVolume() {
return volume;
}
public void setRadius(double radius) {
this.radius = radius;
}
public double getRadius() {
return radius;
}...