Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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)

Then write a client class named CircleClient. It should create an object of class Circle and initialize it to (10.5) and Radius to 7. Print the object Print out its circumference and area. If point(5,7) lies within the clircle print "(5,7) lies within the circle" else print "(5,7)doesnot lie within the clircle".

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Security XI Status And Prospects

Authors: T.Y. Lin, Shelly Qian

1st Edition

0412820900, 978-0412820908

Students also viewed these Databases questions