We are working in 2D and programming in C#. Create a Point class to represent points in 2D. Create an abstract base class named Shape. It should have a position property as a Point. It should be designed as having Move and Resize methods. Create a Line class using Points, derived from Shape class. Its position should be the center of the line. Create a Polygon class representing a closed polygon of Lines, derived from Shape class. Note that, at construction time, Lines may not be provided in order. The continuity and number of the lines should also be checked for a properly closed Polygon. All geometric entities should be moveable. All shapes should be resizable without changing their central positions. All shapes' positions should be their centroids. Shapes should have areas calculated. Write an example C# Console code to demonstrate your program's abilities
We are working in 2D and
Create a Point class to represent points in 2D.
Create an abstract base class named Shape. It should have a position property as a Point. It should be designed as having Move and Resize methods.
Create a Line class using Points, derived from Shape class. Its position should be the center of the line.
Create a Polygon class representing a closed polygon of Lines, derived from Shape class. Note that, at construction time, Lines may not be provided in order. The continuity and number of the lines should also be checked for a properly closed Polygon.
All geometric entities should be moveable. All shapes should be resizable without changing their central positions. All shapes' positions should be their centroids. Shapes should have areas calculated.
Write an example C# Console code to demonstrate your program's abilities.
Step by step
Solved in 2 steps