Question: C# SHAPE HIERACHY It has 7 classes. EmptyTextShape Rectangle Square UpLeftTriangle UpRightTriangle BottomLeftTriangle BottomRightTrangle Shape Hierarchy EmptyTextShape +Width: int read-only +Height : int read-only +Name:

C# SHAPE HIERACHY

C# SHAPE HIERACHY It has 7 classes. EmptyTextShape Rectangle Square UpLeftTriangle UpRightTriangle

It has 7 classes.

EmptyTextShape Rectangle Square UpLeftTriangle UpRightTriangle BottomLeftTriangle BottomRightTrangle

Shape Hierarchy EmptyTextShape +Width: int read-only +Height : int read-only +Name: string read-only +FillCharacter char +Draw: void +Area : decimal +Perimeter: decimal +ToString() string Rectangle +Name string +Area: decimal +Perimeter decimal +ToString(): string Draw simply prints out the contents in the ToString) to the Console. Empty string because it has no shape Square +Name string UpLeftTriangle 45-45-90 triangle +Name string.. +Area : decimal +Perimeter decimal +ToString): string The value of Height in Triangles and Squares will be the same as the Width UpRightTriangle BottomLeftTriangle BottomRightTriangle +Name: string ToString() string +Name : string ToString() string +Name : string ToString() string The class diagram is given in the figure. The ones specified by read-only cannot be changed from outside. However, they are all public members. The shapes are shown next to each class. The Area and the Perimeter will calculate the area and the perimeter of the shape. EmptyTextShape has both of these values to be in addition to an empty string in the ToString() method. The ToString) method overrides will return the actual string of the shape, starting from the beginning and using the character in the FillCharacter, which can be changed anytime and has a default value of asterisk *,-The Draw method will simply print them to Console app. The area and the perimeter will calculate the area. The Name will simply return the class name with spaces instead of camel case in all lower cases (eg. bottom right triangle", or "empty shape" for the base class). With 00P, make sure you've learned how to reuse your codes (logic in constructors, methods, and properties), but I'm not going to enforce it. Learn how to perform commonality analysis. For the triangles, we will use the same width and the same for the height so that they will be 45-45-90 right triangles. Shape Hierarchy EmptyTextShape +Width: int read-only +Height : int read-only +Name: string read-only +FillCharacter char +Draw: void +Area : decimal +Perimeter: decimal +ToString() string Rectangle +Name string +Area: decimal +Perimeter decimal +ToString(): string Draw simply prints out the contents in the ToString) to the Console. Empty string because it has no shape Square +Name string UpLeftTriangle 45-45-90 triangle +Name string.. +Area : decimal +Perimeter decimal +ToString): string The value of Height in Triangles and Squares will be the same as the Width UpRightTriangle BottomLeftTriangle BottomRightTriangle +Name: string ToString() string +Name : string ToString() string +Name : string ToString() string The class diagram is given in the figure. The ones specified by read-only cannot be changed from outside. However, they are all public members. The shapes are shown next to each class. The Area and the Perimeter will calculate the area and the perimeter of the shape. EmptyTextShape has both of these values to be in addition to an empty string in the ToString() method. The ToString) method overrides will return the actual string of the shape, starting from the beginning and using the character in the FillCharacter, which can be changed anytime and has a default value of asterisk *,-The Draw method will simply print them to Console app. The area and the perimeter will calculate the area. The Name will simply return the class name with spaces instead of camel case in all lower cases (eg. bottom right triangle", or "empty shape" for the base class). With 00P, make sure you've learned how to reuse your codes (logic in constructors, methods, and properties), but I'm not going to enforce it. Learn how to perform commonality analysis. For the triangles, we will use the same width and the same for the height so that they will be 45-45-90 right triangles

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!