subject

Task: 1. Define a class named Circle.
2. A Circle object stores a radius and the (x, y) coordinates of its center point using Point class (Point class should be similar to the one we wrote during lectures. It should have at least two private fields to store x and y coordinates of a point, one constructor, a toString method and a distance method).
3. Each Circle object should have 2 private fields, a Point object and radius. Each Circle Object should have the following public method:
Circle (p-radius)
Constructs a new circle with a center specified by the given Point p and with the given integer radius.
getcentert ()
Returns point object for the center of the circle.
getRadius ()
Returns the circle's radius.
getArea ()
Returns the area occupied by the circle, using the formula pir2.
get circumference ()
Returns the circle's circumference (distance around the circle), using the formula 2nr.
teostring ()
Returns a string representation of the circle, such as "Circle [center=(75, 20), radius=30]".
contains (p)
Returns true if the point p lies within the circle else returns false. (Hint: calculate the distance between the center and the point p and compare it with the radius).
Write a client class named CircleClient. It should create an object of class Circle and initialize it to point (10,5) and radius 7. Print the object. 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) does not lie within the circle".

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 19:00
Choose the correct citation for the case which established the "minimum contacts" test for a court's jurisdiction in a case. select one: a. brown v. board of education of topeka, 347 u.s. 483 (1954). b. international shoe co. v. washington, 326 u.s. 310 (1945) c. haynes v. gore, 531 u.s. 98 (2000). d. international shoe co. v. washington, 14 u.s. code 336.
Answers: 1
question
Computers and Technology, 24.06.2019 16:50
Ideally, the backrest is tilted back slightly, so when you turn the wheel your shoulders are the seat.
Answers: 2
question
Computers and Technology, 25.06.2019 04:00
Has anyone noticed that has been giving the wrong answers and that the ads are blocking answers or is that just me?
Answers: 2
question
Computers and Technology, 25.06.2019 04:40
1. instructions: in your response, make an argument for whether for whether it is better for waketown to build its new wake heights subdivision or to preserve the wake wetlan to preserve the wake wetland preserve. use evidence from at least two of the sources below to support your claim. be sure to introduce your precise claim, develop the claim with evidence from the sources, and demonstrate relationships between ideas. (15 points)
Answers: 2
You know the right answer?
Task: 1. Define a class named Circle.
2. A Circle object stores a radius and the (x, y) coord...
Questions
question
English, 15.06.2020 14:57
question
Mathematics, 15.06.2020 14:57
Questions on the website: 13722362