subject

Every cylinder has a base and height, where the base is a circle. Design the class Cylinder that can capture the properties of a cylinder and perform the usual operations on a cylinder. Derive this class from the class Circle. Please do the following: Some of the operations that can be performed on a cylinder are as follows: calculate and print the volume, calculate and print the surface area, set the height, set the radius of the base and set the center of the base.
Write a test program to test your program
class Circle extends Point{
private double radius;
Circle(double xValue, double yValue, double radius){
super(xValue, yValue);
this. radius = radius;
}
public double getRadius() {
return radius;
}
public void setRadius(double radius) {
this. radius = radius;
}
public double getArea(){
return Math. PI*radius*radius;
}
public void printArea(){
System. out. format("Area of the circle: %.2f\n",getArea());
}
public double getCircumference(){
return Math. PI*2*radius;
}
public void printCircumference(){
System. out. format("Circumference of the circle: %.2f\n",getCircumference());
}
}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 16:30
The most common battery cable terminal is a that provides a large surface contact area with the ability to tighten the terminal onto the battery post using a nut and bolt.
Answers: 2
question
Computers and Technology, 23.06.2019 08:00
Michael has written an e-mail to his employees that describes a new product special that will be introduced to the customers next week. by taking time to make sure the e-mail is well written, logical, and organized, michael has made sure his message has the characteristics of a) effective communicationb) ineffective communicationc) barriers to communicationd) workplace communication
Answers: 2
question
Computers and Technology, 23.06.2019 12:00
If you embed a word table into powerpoint, what happens when you make edits to the embedded data? a. edits made to embedded data change the data in the source file; however, edits made to the source file will not be reflected in the embedded data. b. edits made to embedded data will change the data in the source file, and edits made to the source file will be reflected in the embedded data. c. edits made to embedded data don't change the data in the source file, nor will edits made to the source file be reflected in the embedded data. d. edits made to embedded data don't change the data in the source file; however, edits made to the source file will be reflected in the embedded data.
Answers: 1
question
Computers and Technology, 23.06.2019 17:00
What are the 12 colors of the spectrum called?
Answers: 1
You know the right answer?
Every cylinder has a base and height, where the base is a circle. Design the class Cylinder that can...
Questions
question
Mathematics, 08.06.2020 10:57
question
Mathematics, 08.06.2020 10:57
question
Social Studies, 08.06.2020 10:57