Using the solution from a previous exercise, augment your code as follows: 1. Implement the Factory Method

Question:

Using the solution from a previous exercise, augment your code as follows:

1. Implement the Factory Method pattern to create various shapes. You will have already created an abstract base class of shape and derived classes such as Rectangle, Circle, Triangle, and possibly square.

2. Choose whether to implement your Factory Method as a static method in shape or as a method in a ShapeFactory class (introducing the latter class if necessary).

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer: