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 02:00
When jen is planning to upgrade to a monitor with a better resolution, what should she be looking for in the new monitor?
Answers: 1
question
Computers and Technology, 22.06.2019 14:30
Create a pseudocode design to prompt a student for their student id and the titles of the three classes they want to add. the solution should display the student’s id and a total bill. • bill a student using the following rules: o students can only add up to 3 classes at a time.
Answers: 3
question
Computers and Technology, 22.06.2019 23:30
What are some ways to use a range name in a formula? check all that apply. in the defined names group, click use in formula, and then select the desired name. begin typing the name in the formula, select a name from the autocomplete list, and use the arrow keys and tab key to enter the name in the formula. begin typing the formula, and then click and drag with the mouse to select the cells to include in the formula. right-click one of the cells in the range. click formula options, and use the dialog box to add the name.
Answers: 1
question
Computers and Technology, 24.06.2019 04:30
1. web and mobile applications allow users to be actively engaged in an online activity. a true b false 2. some examples of business applications purposes are to collaborate, share files, meet virtually in real-time, and accept payments. a true b false 3. an education application would most likely do which of the following? a allow users to watch popular movies and tv shows b connect users with social and business contacts c confirm users' travel plans d teach users a new language 4. a uniform resource locator (url) is how the internet knows where to take users when an address is typed into a browser. a true b false 5. deon is required to provide the citation information for his sources. what type of information should he collect from his sources? a author name, title, date of publication, date of access, url b connections to background information c interesting facts and statistics d notes on important information
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, 28.02.2020 05:22
question
Mathematics, 28.02.2020 05:22
question
History, 28.02.2020 05:22
question
Mathematics, 28.02.2020 05:23
Questions on the website: 13722361