WOD3: Rectangle Class with Outline
So far we have created a Circle, Square, and Rectangle class. Next we’ll update your Rectangle class by adding support for an outline color.
Rx: <10 min
Av: 10-20 min
Sd: 20-30 min
DNF: 31+ min
Instructions
- Write down your start time on your notecard.
- If you haven’t been following along, download the Shapes Project and import it into your workspace.
- Add a new field,
outlineColor
, to the Rectangle
class.
- Update the constructors to support the outline. You should have 3 constructors:
- Default constructor (no parameters)
- Constructor with 5 parameters (no
outlineColor
)
- Constructor with 6 parameters (one for each field)
- Add get & set methods for the outline color.
- Update the
paint
method to draw the outline.
- Test your Rectangle changes in Picture.
- Run the program to verify your changes.
- Export your program by right-clicking on your project folder, and selecting
Export > General > Archive File
. Name the file RectangleOutline_uLogin.zip
.
- Upload the file to the assignment page on canvas.
- Write down your stop time on your notecard.