Question: Using JAVA Exercise#1 Design a class Circle that can store the radius and x, y coordinates of the center. Implement all the get/set methods, toString()

Using JAVA

Using JAVA Exercise#1 Design a class Circle that can store the radius

Exercise#1 Design a class Circle that can store the radius and x, y coordinates of the center. Implement all the get/set methods, toString() method along with the usual operations on a circle, such as calculating the area and circumference. Design a class Cylinder that extends the class Circle. Implement all the get/set methods, toString() method and the usual operations on a cylinder such as calculating the volume and surface area. Write a test program to input the x,y coordinates of the centre, the radius and the height of a cylinder and print its volume and surface area. Formulas you need to use: Area of a Circle = PI*radius * radius . Circumference of a Circle = 2*P1*radius Surface Area of a Cylinder = 2 * areaOfCircle + height * circumferenceOfCircle Volume of a Cylinder = height * areaOfCircle Sample Input/Output Enter the x value of the center: 5 Enter the y value of the center: 4 Enter the radius: 7.23 Enter the height: 2.30 myCylinder: Surface area of my Cylinder : 432.92 Volume of myCylinder : 377.71

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!