|
Spring Semester 2005
|
Here's some code we will discuss:
class Point {
double x, y;
Point(double x, double y) {
this.x = x;
this.y = y;
}
public String toString() {
return "I am a Point at (" + x + ", " + y + ")";
}
}
class Circle {
private double radius, x, y;
Circle(double r, double x, double y) {
radius = r;
this.x = x;
this.y = y;
}
Point center() {
return new Point(this.x, this.y);
}
double radius() {
return radius;
}
}
class Rectangle {
double x, y, width, height;
Rectangle(double x, double y, double width, double height) {
this.x = x;
this.y = y;
this.width = width;
this.height = height;
}
}
Then there's this set of problems.
And the solutions are posted here (and briefly reviewed here). There's also an older lab that illustrates the process in greater detail.
Now the rest of the notes (below) simply illustrates how we will use our visualization tool.
Start BlueJ.




Sixteen in my case.




BankAccount, in my case.






javac).




one.




two).








deposit(amount).



Tue Mar 1 09:58:23 EST 2005