Question: 7. (a) Create a class circle with the following private attributes, (5 X 4 =20) id: an integer, start from 1 x: abscissa of the

 7. (a) Create a class circle with the following private attributes,

7. (a) Create a class circle with the following private attributes, (5 X 4 =20) id: an integer, start from 1 x: abscissa of the center y: ordinate of the center radius: radius of the circle Implement the following methods in your class (You may add other methods if necessary): i) One or more constructors as needed. ii) setX (float x), sety (float y), setRadius (float radius): these functions would set the abscissa of the center, ordinate of the center and the radius of the circle respectively. getArea(): this would return the area of the circle. isInside (circle cl): this would return a Boolean value. It would iii) iv) check whether circle c1 is completely inside of this circle. v) printInfo(): prints the id, x, y and radius of the circle

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!