Make a class called MyCircle, which models a circle.The class contains: • One private instance variables: radius (int). • A constructor that constructs a circle with the given radius. • Write getter...


Make a class called MyCircle, which models a circle.The class contains:


• One private instance variables: radius (int).


• A constructor that constructs a circle with the given radius.


• Write getter to get radius of the circle.


• Write setter to set the radius of the circle.


• A getArea() method that returns the area of the circle in float.


Area of Circle = pr2 (p represent pi value)


• A getCircumference() method that returns the circumference of the circle.


Circumference of Circle= 2pr (p represent pi value)


Create main class that construct two circles, assign radius to both circles and display their respective area and circumference.



Make a class called MyCircle, which models a circle. The class contains:<br>One private instance variables: radius (int).<br>A constructor that constructs a circle with the given radius.<br>Write getter to get radius of the circle.<br>Write setter to set the radius of the circle.<br>A getArea() method that returns the area of the circle in float.<br>Area of Circle = pr2 (p represent pi value)<br>A getCircumference() method that returns the circumference of the circle.<br>Circumference of Circle= 2pr (p represent pi value)<br>6.<br>Create main class that construct two circles, assign radius to both circles and display<br>their respective area and circumference.<br>

Extracted text: Make a class called MyCircle, which models a circle. The class contains: One private instance variables: radius (int). A constructor that constructs a circle with the given radius. Write getter to get radius of the circle. Write setter to set the radius of the circle. A getArea() method that returns the area of the circle in float. Area of Circle = pr2 (p represent pi value) A getCircumference() method that returns the circumference of the circle. Circumference of Circle= 2pr (p represent pi value) 6. Create main class that construct two circles, assign radius to both circles and display their respective area and circumference.

Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here