Question
Define a class named Circle. A Circle object stores a radius and the (x,y) coordinates of its center point. Each circle object should have 3
Define a class named Circle. A Circle object stores a radius and the (x,y) coordinates of its center point. Each circle object should have 3 private fields. x-coordinate, y-coordinate and radius. Each circle object should have the following public methods
. Circle (x,y,radius)
. getX()
. getY()
. getRadius ()
. getArea
. getCircumference ()
. toString ()
. contains (x.y)
write a client class named CircleClient. It should create an object of class Circle and initialize it to (10.5) AND radius . Print out its circumference and area. If point (5,7) lies within the circle print"(5,7) lies within the circle" else print"(5,7) doesnot lie within he circle".
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started