Question: FIND ERRORS 2) Consider the following class declaration: public class Circle private double radius private void getArea () return Math. PI radius radius; private double

FIND ERRORS

FIND ERRORS 2) Consider the following class declaration: public class Circle private

2) Consider the following class declaration: public class Circle private double radius private void getArea () return Math. PI radius radius; private double getRadius () return radius; 1) Write a copy constructor for this class 2) Write an equals method for this class. The method should accept a Circle object as an argument. It should return true if the argument object contains the same data as the calling object, or false otherwise 3) Write a class that has three overloaded static methods for calculating the areas of the following geometric shapes 1) circles 2) rectangles 3) cylinders Here are the formulas for calculating the area of the shapes Area of a circle: Area-mr where is Math.PI and r is the circle's radius Area of a rectangle: Area = widths length Area of a cylinder: Area h where is Math.PI, r is the radius of the cylinder's base, and h is the cylinder's height Because the three m ethods are to be overloaded, they should each have the same name, but different parameter lists

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!