Saved Papers

Save papers so you can find them more easily...


Join Now

Get instant access to our database of over 100,000 papers.

Join Now!

Computer Program


Join Now
Credit Card
Join Now
PayPal
 

package point;

import java.text.DecimalFormat;

public class Point {

protected double x;
protected double y;
public Point() {
x=0.0;
y=0.0;
}
public Point(double theX, double theY) {
x=theX;
y=theY;
}
public void setPoint(double theX, double theY) {
x=theX;
y=theY;
}
public double getX() {
return x;
}
public double getY() {
return y;
}
public double distanceTo(Point t) {
return Math.sqrt(Math.pow(x-t.x,2)+Math.pow(y-t.y,2));
}
public double distanceToOrigin() {
return Math.sqrt(x*x+y*y);
}
public String toString() {
DecimalFormat df;
df=new DecimalFormat("0.000");
return "("+df.format(x)+","+df.format(y)+")";
}
}

package assignment2;

import java.text.DecimalFormat;

public class Circle extends Point{

protected double radius;

public Circle() {
super();
radius=0;
}
public Circle(double theX, double theY, double theRadius) {......

Join Now or Login to view the rest of this paper.

Approximate Word Count: 604
Approximate Pages: 3 (260 words per double-spaced page)

Why should you join TermPapersMonthly?
- It's secure and completely anonymous.
- You get instant access to over 100,000 papers.
- Prompt and helpful customer support.

Credit Card
PayPal