Part IV: UML design question (15 points * 1) Please draw a UML class diagram based on the following description: (Note:
Posted: Tue May 24, 2022 8:00 am
Part IV: UML design question (15 points * 1) Please draw a UML class diagram based on the following description: (Note: you can use the Violet UML Editor or other tools, or simply draw this on a paper, and then insert a photo/screenshot on the answer sheet.) Shape is a superclass, that has two private attributes, i.e., perimeter: double and area: double, and two public methods, i.e., getPerimeter(): double, get Area(): double. Triangle, Square, and Rectangle are subclasses that inherit Shape. Triangle has two additional private attributes, i.e., type: char and edges: Edgell, and three public methods, i.e., getPerimeter(): double, getArea(): double, and classify(): char. Square and Rectangle are similar to Triangle, except that they do not have the attribute type and the method classify(). In addition, class Edge has two private attributes, i.e., length: double, and points: Endpoint[], and a public method getLength (): double. Class Endpoint has two private attributes, i.e., x: double, y: double, and two public getter methods. Note that each Triangle has three edges, which is a one-to-three relationship; each Square or Rectangle has four edges, which is a one-to-four relationship, and each Edge has two endpoints, which is a one-to-two relationship.