Question: Question 4 Part I a. Creat e a class Circle with attributes x, y, radius and color. The x and y represent the cirele origin

 Question 4 Part I a. Creat e a class Circle with
attributes x, y, radius and color. The x and y represent the

Question 4 Part I a. Creat e a class Circle with attributes x, y, radius and color. The x and y represent the cirele origin and can be any real number. The radius is defaulted to 1 with "black" color. b. The class should have set and get methods for all the attributes. The set radius method should validate that the radius is a positive numberless than 100. If not, it should set the radius to default value of 1. c. The circle can be constructed with two different constructors I. The default constructor with no actual parameters with all default values. 2. A full constructor which takes x,y,radius and color as input to initialize the object. You should also provide methods that calculate the Circle perimeter and area. d. Part I Test the class Circle by creating two circles (el) and (2) taking in consideration the following C I should be constructed with default constructor but adjusted to be l (-5.0,-3.0) with blue color and a radius of 3. c2 sh with radius of 4 and blue color. Print the area of circle 1 ated at the origin ould be instantiated with the full constructor with center located at the point (5,10) Print the perimeter of circle2

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!