Question: C# - With VISUAL STUDIO Create an abstract class called shape Shape will have an abstract property called area Shape will have a static backing

C# - With VISUAL STUDIO

Create an abstract class called shape

Shape will have an abstract property called area

Shape will have a static backing field called _count

Shape will have a read-only property that will return the number of shapes created (the _count)

Shape will have a constructor that will increment the count field

Create a concrete class called rectangle

Inherits from shape

Will have 2 fields

Width

Height

No properties for the fields

Will have a constructor that will take in a width and height and will assign them to the fields

Rectangle will implement area and will return the width x height

Create a concrete class called circle

Inherits from shape

One field

Diameter

No properties for the field

Constructor will take in and set the diameter

Returns area ( 3.14 * ( * diameter)* ( * diameter)

Write code that

will create 3 rectangles and return their area

output the number of shapes created

will create 2 circles and return the area

output the number of shapes created

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!