Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You must follow the specifications exactly (To demo to instructor at the end of this class) Because the required code statements is very few, you
You must follow the specifications exactly (To demo to instructor at the end of this class) Because the required code statements is very few, you may choose to implement all the classes in a single code file There are seven classes participating in this application as shown in the diagram above. Each of the seven classes is fully described below. You will need to "google" how to declare an abstract property. Not all base classes are abstract object is the parent class of all classes and it is not abstract. Square is the parent class of Circle and it is not abstract. Similarly Rectangle is the parent class of Ellipse, Triangle and Diamond and it is not declared abstract. Description of class members Some decorators for classes are Fields: There are no fields abstract it cannot be instantiated Properties: sealed it cannot be the parent of There are two properties in which one of them is auto-implemented. static all members are static, Name - this string property represents the name of this object. The getter is public and the setter is partial type is fully implemented in private. multiple files Area - this property represents the area of this shape. This is an abstract property that is implemented in the derived classes. There is no set accessor. Constructor: Shape(string name) - This constructor takes a string parameter and assigns it to the appropriate property. Methods: public override string Tostring() - This is a public method overrides the corresponding method in the object class to return the Name and the Area of this object. You get to decide how the properties will be display to the user. Description of class members Fields: There are no fields Properties: There are two properties in which one of them is auto-implemented. Length - this double property represents the length of this object. The getter is public and the setter is protected. Area - this property represents the area of this shape. This property returns the square of the length. Constructor: Square(string name, double length) - This constructor takes two parameter, it invokes the base constructor with the first one and assigns the second one to the appropriate property. Methods: There are no methods The Circle class This class inherits from the Square class and it comprises of three members: Circle Class Square Properties + Area : double Methods + constructor Circle(string name, double length) Description of class members Fields: There are no fields Properties: There is a calculated property. Area - this property represents the area of this shape. The getter returns Length Length. Constructor: Circle(string name, double length) - This constructor takes two parameter, it invokes the base constructor with both of them. Methods: There are no methods This class inherits from the Shape class and it comprises of three members: Rectangle Class Shape Properties \# > Width : double # Height : double +> Area : double Methods + Area : double Methods + Height 0.5. Constructor: Diamond(string name, double height, double width) - This constructor takes three parameters, it invokes the base constructor with all of them. Methods: There are no methods Test Harness Copy the following lines to the Main method in the Program.cs file
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