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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started