// Arup Guha
// 7/14/04
// Incomplete implementation of a Point class.
// 2004 BHCSI Homework: To complete the methods that are left blank and to
//                      test these methods from main.

public class Point {

  private int x;
  private int y;

  public Point() {
    x = 0;
    y = 0;
  }

  public Point(int xval, int yval) {
    x = xval;
    y = yval;
  }

  public int SumCoordinates() {
    return x+y;
  }

  // Returns the distance from the origin to the current object.
  public double getDistance() {
    
  }

  public String toString() {
    return "("+x+","+y+")";
  }

  public void reflectXaxis() {
    y = -y;
  }

  // Reflects the current object over the y-axis.
  public void reflectYaxis() {
    
  }

  // Reflects the current object over the origin.
  public void reflectOrigin() {
  
  }

  public boolean equals(Point p2) {
    if (x == p2.x && y == p2.y)
      return true;
    else
      return false;
  }

  public void setX(int xval) {
    x = xval;
  }

  // Changes the y coordinate of the current object to yval.
  public void setY(int yval) {
   
  }

  // Multiplies the current object by a scale factor of c.
  public void multC(int c) {
    
  }

  public void translate(Point p2) {
    x = x+p2.x;
    y = y+p2.y;
  }

  // Returns true if the current object and p2 form a vertical line.
  public boolean vertical(Point p2) {
    
  }

  public boolean horizontal(Point p2) {
    if (y == p2.y)
      return true;
    else
      return false;
  }

  // Returns the slope of the line connecting the current object to p2.
  public double slope(Point p2) {





  }

  public static void main(String[] args) throws IOException {

    Point p1 = new Point();
    Point p2 = new Point(7, 10);
    Point p3 = new Point(-4, -4);

    int sum = p2.sumCoordinates();
    System.out.println("The sum of the coordinates of p2 is "+sum);

    System.out.println("Before reflect X-axis, p3 is "+p3);
    p3.reflectXaxis();
    System.out.println("After reflect X-axis, p3 is "+p3);
    
    System.out.println("Originally, p1 was "+p1);
    p1.setX(-4);
    System.out.println("p1 is now "+p1);
    
    if (p1.horizontal(p3))
      System.out.println("p1 and p3 are on a horizontal line.");

  }
}
