Question: 1 . Add to the House class a method named changeRoofColor that has a String parameter variable and changes the color of roof according to
Add to the House class a method named changeRoofColor that has a String parameter variable and changes the color of roof according to the argument passed in the parameter. Use changeColor, not setColor.
Add to the House class a method named changeWallColor that has a String parameter variable and changes the color of wall according to the argument passed in the parameter. Use changeColor, not setColor.
Add to the House class a method named changeWindowColor that has a String parameter variable and changes the color of window according to the argument passed in the parameter. Use changeColor, not setColor.
Add to the House class a method called moveHorizontal that takes an integer as input and moves the entire house that distance horizontally to the right for a positive integer and to the left for a negative integer
This method needs to call the moveHorizontal methods for wall, roof, and window. You must move wall first because otherwise it will overwrite the move of window.
Add to the House class a method called moveVertical similar to moveHorizontal that takes an integer as input and moves the entire house that distance vertically.
Add to the House class a method called makeInvisible that makes the entire house invisible.
Add to the House class a method called makeVisible that makes the entire house visible again.
The code in question these must be added to:
public class House
private Square wall;
private Triangle roof;
private Square window;
No parameter constructor for objects of class House.
public House
wall new Square;
wall.makeVisible;
wall.changeSize;
wall.moveHorizontal;
wall.moveVertical;
roof new Triangle;
roof.makeVisible;
roof.changeSize;
roof.moveHorizontal;
roof.moveVertical;
roof.changeColorblack;
window new Square;
window.makeVisible;
window.moveHorizontal;
window.moveVertical;
window.changeColorblue;
This is the main method.
@param args commandline arguments not used
public static void mainString args
House house new House;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
