Question: JAVA QUESTION Suppose you are designing an object-oriented drawing application to draw circles, rectangles, lines, and curves. These objects all have certain states (for example:

JAVA QUESTION

Suppose you are designing an object-oriented drawing application to draw circles, rectangles, lines, and curves. These objects all have certain states (for example: position, orientation, outline color, fill color ) and behaviors (for example: moveTo, rotate, resize, draw ) in common. Some of these states and behaviors are the same for all graphic objects (for example: position, fill color, and moveTo). Others require different implementations (for example, resize and draw). All the four graphic objects must be able to draw and resize themselves; they just differ in how they do it.

(a) Describe how could you implement these objects using classes.

(b) Draw a UML that shows your proposed OOP design. Show on the UML the data fields (states), the methods (behavior) inside each class, and the relationships between the classes.

Note: No codes are required in this question.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!