CircleXY Class

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • miss time
    New Member
    • Jun 2007
    • 16

    #1

    CircleXY Class

    Hi ,
    I try to solve this question, but I have difficulty to solve sub question for this problem
    The question is to use the PointXY class that I wrote before to write a class in java that represents the circles in 2 dimensions. A circle can be represented as one point, radius, and color. The name of the class must be: CircleXY. I solve class constructor for this class, I Wrote a getter and a setter method for the each data member , I Wrote the toString method and Wrote a method in which I compute and returns the area and perimeter of the circle , but I don’t understand these questions
    1. Given a point v, write a method in which it checks whether v lies inside the circle or not.
    2. Reuse the method in 1 to check if a point lies on the circumference of the circle or not.
    3. Reuse both methods in 1 and 2 to check if a point lies outside the circle or not. And also I don’t understand how to use getter to print circle they gave.( i implement these code in Bluej)
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by miss time
    Hi ,
    I try to solve this question, but I have difficulty to solve sub question for this problem
    The question is to use the PointXY class that I wrote before to write a class in java that represents the circles in 2 dimensions. A circle can be represented as one point, radius, and color. The name of the class must be: CircleXY. I solve class constructor for this class, I Wrote a getter and a setter method for the each data member , I Wrote the toString method and Wrote a method in which I compute and returns the area and perimeter of the circle , but I don’t understand these questions
    1. Given a point v, write a method in which it checks whether v lies inside the circle or not.
    2. Reuse the method in 1 to check if a point lies on the circumference of the circle or not.
    3. Reuse both methods in 1 and 2 to check if a point lies outside the circle or not. And also I don’t understand how to use getter to print circle they gave.( i implement these code in Bluej)
    How would you do these problems manually?You just need to convert the formulas into java methods.

    Comment

    Working...