Define the circle class that contains data field radiuses


JAVA PROGRAM

Define the Circle class that contains:

Data field radiuses with get and set methods.

A no-arg constructor that creates a default Circle with radius value 1.

A constructor that creates a circle with specified radius.

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

A method getPerimeter() that returns the perimeter of the circle.

Define the TestCircle class that contains:

Object of circle c1 (no-arguments)

Object of circle c2 (passing radius value 5)

Display Circle c1 radius, area and perimeter

Set c1 radius to 6 and c2 radius to 7

Display Circle c2 radius, area and perimeter

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Define the circle class that contains data field radiuses
Reference No:- TGS01466959

Now Priced at $20 (50% Discount)

Recommended (97%)

Rated (4.9/5)