I really cannot find anything wrong with this, I have checked it at least 5 times, and there is nothing I see that can make the driver not recognize the constructor. Ok, so here is my Rectangle class
import gpdraw.DrawingTool;
import gpdraw.SketchPad;
public class Rectangle {
private double base;
private double height;
private DrawingTool myPencil;
private SketchPad myPad;
public Rectangle(double w, double h, SketchPad pad){
base = w;
height = h;
myPad = pad;
myPencil = new DrawingTool(pad);
}
public void drawRect(){
myPencil.drawRect(base, height);
}
public double getPerimeter(){
return 2*base + 2*height;
}
public double getArea(){
return base*height;
}
}
This compiles fine, the computer doesn't complain about any errors. This driver seems to be causing problems, even though I don't know what is wrong.
Here is my driver
import gpdraw.DrawingTool;
import gpdraw.SketchPad;
public class Driver{
public static void main(String[] args){
SketchPad paddy = new SketchPad(500, 500);
Rectangle rect1 = new Rectangle(100, 300, paddy);
Rectangle rect2 = new Rectangle(300, 100, paddy);
Rectangle rect3 = new Rectangle(300, 300, paddy);
}
}
I pass in SketchPad object paddy to the constructor, but here is the error message I get when I compile the driver
cannot find symbol constructor Rectangle(int,int,gpdraw.SketchPad) line 9
cannot find symbol constructor Rectangle(int,int,gpdraw.SketchPad) line 10
cannot find symbol constructor Rectangle(int,int,gpdraw.SketchPad) line 11
This is really bugging me, is there something wrong with my entire computer?