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

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter11: Advanced Inheritance Concepts
Section: Chapter Questions
Problem 3PE
icon
Related questions
Question

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. 

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Data members
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,