The class is supposed to allow for methods to be run of it so a picture can be drawn. I'm still getting the same problem, i can't seem to figure out how to separate 2 constructors in the same Square class, so that the mypicture class can have on method created to allow for a house to be drawn.
--- Update ---
This is the instruction i have to carry out. It's annoying because once i have this down i can get the rest of the excercise done in time for tommorow because it's all just the same adding new methods.
"Our new class doesn’t draw very much. We can change that by adding the following method:
/**
* Builds a house with 1 window on the canvas.
* In order to do this it has to instantiate (gives initial values)
* to some of its attributes.
* This is done by using constructors from the appropriate classes.
* These shape objects are then made visible by using their classes'
* makeVisible() methods.
*/
public void createOneWindowHouse(){
square1 = new Square(110, 60, 90, "red");
square2 = new Square(30, 70, 110, "blue");
triangle1 = new Triangle(50, 150, 114, 40, "green");
square1.makeVisible();
square2.makeVisible();
triangle1.makeVisible();
}
This method will only compile and work if you have appropriate constructors in the Square and Triangle classes. If you don’t, add them to the relevant classes. Notes from lab 2 should help. The values given as parameters should give you a house. The order for the parameters is as follows:
Square: size, xPosition, yPosition, color
Triangle: height, width, xPosition, yPosition, color
If not already there, add the appropriate constructors to the Square & Triangle classes.
Add the above class, with comments, to the new class.
Compile
Test
--- Update ---
To add pressure to pressure already, if i don't nail this i'll fail my course 0_o literally fail it.