Lab #2
|
Design an abstract Shape class that has abstract methods draw and resize. The class has also a getShapeName
method and a toSting method that returns the name of the shape drawn and prints it on the screen.
Implement the following shapes:
Design a test program for the Shapes. The program is an application. The shapes are drawn on command window (unless you know how to create a panel). The test program provides the names of the shapes and the sizes to be drawn as follows:
Since we are doing graphics in this lab a container is needed. The container can be any of your choice, Applet, Frame, or a Panel (within the applet or the frame) There is a sample program available. |