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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started