Howdy. 

This is where we document code written in the first lecture (08:00am).

Exam Three: Homework Seven materials. 

A Study Guide will be posted on Wednesday. 

Homework Eight and Nine extended a week each. 

BlueJ just eliminates the need for a main. 

class Circle {
  Point center;
  double r; 
  Circle(Point center, double r) {
    this.center = center; 
    this.r = r; 
  }
  boolean overlap(Circle other) {
    return this.center.distanceTo(other.center) <= this.r + other.r;  
  } 
  boolean contains(Point somePoint) {
    return this.center.distanceTo(somePoint) <= this.r;
  }
  public String toString() {
    return "C@" + this.center + this.r;
  } 
}

class Point {
  int x, y; 
  Point(int x, int y) {
    this.x = x;
    this.y = y; 
  }
  double distanceTo(Point other) {
    int dx = this.x - other.x; 
    int dy = this.y - other.y;
    return Math.sqrt( dx * dx + dy * dy ); 
  } 
  public String toString() {
    return "(" + this.x + ", " + this.y + ")"; 
  }
}

class Thomas {
  public static void main(String[] args) {
    Circle a, b;
    a = new Circle(new Point(0,0), 1.41);
    b = new Circle(new Point(2,2), 1.41); 
    System.out.println( "Does " + a + " overlap with " + b + "?");
    System.out.println( "Answer: " + a.overlap(b) ); 
  }
}

class Utilities {
  public static overlap(Circle a, Circle b) {
    return a.overlap(b);     
  }
  public static contains(Circle a,  Point b) {
    return a.contains(b); 
  } 
}