Ch 2: 2.7 - 2.10

Record your participation in Piazza clicker question Lesson3 Q1
Given this definition
Rectangle rec = new Rectangle(100, 200, 50, 80);
what does the variable rec hold?
Record your participation in Piazza clicker question Lesson3 Q2
Given this code
Rectangle block = new Rectangle(10, 20, 30, 50); Rectangle block2 = block; block2.grow(0, 10); System.out.println(block.getHeight() + " : " + block2.getHeight());
What is printed? (Remember the grow method adds to both sides.)
Record your participation in Piazza clicker question Lesson3 Q3
What does this code print? (Remember the grow method adds to both sides.)
Rectangle tile1 = new Rectangle( 10, 30, 50, 100); Rectangle tile2 = new Rectangle( 10, 30, 50, 100); tile2.grow(5, 0); System.out.println(tile1.getWidth() + " " + tile2.getWidth());
Record your participation in Piazza clicker question Lesson3 Q4
What is printed here?
String farewell = "Goodbye, Moon";
farewell.toLowerCase();
farewell.replace("o", "");
System.out.println(farewell);
Record your participation in Piazza clicker question Lesson3 Q5
What is printed here?
String farewell = "Goodbye, Moon";
String copy = farewell.toLowerCase();
copy = copy.replace("o", "");
copy = copy.replace("e", "3");
System.out.println(copy);
System.out.println(farewell);
gdby3, mn gdby3, mn
gdby3, mn Goodbye, Moon
Record your participation in Piazza clicker question Lesson3 Q6
Draw a staircase like the one below. The upper left hand corner is at (20, 10). Each step is 20 pixels tall. The first step is 20 pixels wide. Each of the following steps is 20 pixels wider than the one above.

Here is a zip containing the frame and component classes needed for drawing in a graphical application. Make a project in your IDE and add them. You can use this same set of starter classes for any graphics project we do.
Rectangle step1 = new Rectangle(20, 10, 20, 20);
g2.setColor(Color.BLUE);
g2.draw(step1);