Created
April 1, 2014 05:53
-
-
Save JorgeOlvera/9908442 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class myCircle{ | |
int rad = 1, x, y; | |
MyPoint center; | |
double area = null; | |
public MyCircle(int xVal, int yVal, int rad){ | |
rad = 1; | |
x = xVal; | |
y = yVal; | |
} | |
public MyCircle(myPoint CircCenter, int CircRadius){ | |
center = CircCenter; | |
rad = CircRadius; | |
} | |
public int getRadius(){ | |
return rad; | |
} | |
public void setRadius(int Circleradius){ | |
rad = Circleradius; | |
} | |
public MyPoint getCenter(){ | |
return center; | |
} | |
public void setCenter(MyPoint CircCenter){ | |
center = CircCenter; | |
} | |
public int getCenterX(){ | |
return x; | |
} | |
public int getCenterY(){ | |
return y; | |
} | |
public void setCenterXY(int circleX, int circleY){ | |
x = circleX; | |
y = circleY; | |
} | |
public void toString(){ | |
System.out.println("center: " + center + " radius: " + rad + " x: " + x + " y: " + y); | |
} | |
public double getArea(){ | |
area = 3.14 * rad * rad; | |
return area; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment