Answer:
its b
Explanation:
its propellant hope I got it to you in time
' if the rectangles were drawn, they would form one larger rectangle.'
That part of the question I don't get.
To print the location of the Rectangle write a toString method in the
Rectangle class.
When using the System.out.println method the toString method of that
object will be called.
If you have to translate the rectangle only when the
System.out.println() methode is used you should translate the rectangle
object in the toString methode.
So the translate method keeps the translated cordinates, but only
translates the rectangle when the toString is called.
So the to string method would be something like that:
String toString(){
return "X-cord.: "+ (this.X1+this.translatedX) +"-"+
(this.X2+this.translatedX) +"
Y-cord.:"+(this.Y1+this.translatedY)+"-"+(this.Y2++this.translatedY);
}
Answer:
If you want to change a variable, just re-define it.
For example:
colour = print("red")
To change the value of the colour variable, just type:
colour = print("orange")
If you want the user to input text that changes the variable, do this:
colour = input("pick a colour")
Hope it helps ! :)