THis is my question and I have no idea how to do it.

Write a GrowSquarePrinter program that constructs a Rectangle object square representing a square with top-left corner (100, 100) and side length 50, prints its location by calling System.out.println(square), applies the translate and grow methods, and calls System.out.println(square) again. The calls to translate and grow should modify the square so that it has twice the size and the same top-left corner as the original. If the squares were drawn, they would look like the figure at right.

Recommended Answers

All 3 Replies

You printed the same variable twice. You would either have to change it, or make a different one.

commented: This seems to be an answer to a completely different question! -3
Member Avatar for iamthwee

If the squares were drawn, they would look like the figure at right.

What figure at right?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.