Friday 27 August 2010

AP Computer Science Chapter 1 Test


The creation of the Pezant:To create many parts of the pezant we had to create a new class named box and replaced its default code with the source code of the class square. I then invoked the method draw() and saw that the box acts same as a square object. Later i changed the field size with parameters of type int (parameter n and parameter w) to determine the height and width of the object. I created different multiple instances of box object to create his arms and legs and then changed the paramters of the circle and triangle to create his head and hat. when all of the objects were in visible state, after calling the method ,makeVisible, i saw which objects i need to move in attempt to create the perfect pezant.