holavi Dekann

holavi Dekann

  • NA
  • 5
  • 2.2k

C# create ShapesDemo

Nov 3 2014 8:10 PM
create an application named ShapesDemo that creates several objects that descent from abstract class called GeometricFigure. Each GeometricFigure include a height, width and an area. provide get and set accessors dor each field except area; the area is computed and is read-only. include and abstract method called ComputeArea() that computes the area of the GeometricFigure.
  • A Rectangle is geometricFigure whose area is determined by multiplying width by height.
  • a Square is a Rectangle in which the width and height are the same. provide a constructor that accepts both height and width, forcing them to equal if they are not. provide a second constructor that accepts just one dimension and uses it for both height and width. The square class uses the rectangle's ComputeArea() method.
  • A Triangle is a Geometric
  • figure whose area is determined by multiplying the width by half the height.

Answers (4)