So far we have created a Circle class. Next we’ll create a Square class.
Rx: <10 min Av: 10-20 min Sd: 20-30 min DNF: 30+ min
Square
class. Go ahead and check the box for Eclipse to create a main method.x
, y
, width
, and color
. Integers recommended.getArea()
and a getPerimeter()
method & test them in main by creating a Square variable & initializing it by calling one of the constructors.paint
method that draws the square. Once you’ve finished doing the HW a single time, watch me do it:
You’ll learn significantly less from watching me solve the practice HW if you haven’t attempted the HW yourself first.
While it’s an achievement to finish the HW no matter how long it takes, you might experience “diminishing returns” if you work longer than the DNF time. Thus, it might be strategic to stop working at the DNF time and watch my solution.
After watching my solution, I recommend that you repeat the HW if you have not achieved at least Av performance. If so, be sure to:
Feel free to keep trying until you make Rx if that’s of interest to you.