please use c# i will upload figure 11.3 as image and please follow the requirement below the question (Shape Hierarchy) Implement the Shape hierarchy of Fig. 11.3. Omit the Triangle and Tetrahedron classes. Each TwoDimensionalShape should contain read-only abstract property Area to calculate the area of the two-dimensional shape. Each ThreeDimensionalShape should have read-only abstract properties Area and Volume to calculate the surface area and volume, respectively, of the three-dimensional shape. Create an app that uses an array of Shape references to objects of each concrete class in the hierarchy. Display a text description of the object to which each array element refers. Also, in the loop that processes all the shapes in the array, determine whether each shape is a TwoDimensionalShape or a ThreeDimensionalShape. If a shape is a TwoDimensionalShape, display its area. If a shape is a ThreeDimensionalShape, display its area and volume. please use the below requirement when doing the code PROCESSING LOGIC The processing should be defined by summarizing the control and data flow within the main program. Techniques of process specification include Program Design Language, Pseudo Code and Flow Charts. The main program flow must be supplemented with the flow of subroutines/methods/functions that are called from the main program. Any specific algorithms to be used should be stated or referenced. DATA (INPUT/OUTPUT) The logical and physical data structure of files should be defined in detail. Data structure definitions must include the: a. description of each element, e.g. name, type, dimension; b. relationships between the elements, i.e. the structure and source; c. range of possible values of each element; d. initial values of each element. COMPONENTS (SOURCE CODE NAMES, CLASSES, METHODS) Describe the software components (names or classes) and purpose that will be used. Include UML class diagram showing the properties and methods of the class. Describe the properties of the class and any constraints upon their value. Indicate where the algorithms defined in processing logic are implemented. TESTING Present one or more named scenarios including the input data, expected output and the success criteria desired that will be utilized to test the application. The testing plan should be repeatable so discuss any ‘clean up’ that might be required to do so. Example Scenario 1 – divide by zero test Steps to test Enter zero in the divisor. Expected reaction Expected results is a message saying ‘Zero is not a valid input. Please try again’.
please use c#
i will upload figure 11.3 as image and please follow the requirement below the question
(Shape Hierarchy) Implement the Shape hierarchy of Fig. 11.3. Omit the Triangle and Tetrahedron classes. Each TwoDimensionalShape should contain read-only abstract property Area to calculate the area of the two-dimensional shape. Each ThreeDimensionalShape should have read-only abstract properties Area and Volume to calculate the surface area and volume, respectively, of the three-dimensional shape. Create an app that uses an array of Shape references to objects of each concrete class in the hierarchy. Display a text description of the object to which each array element refers. Also, in the loop that processes all the shapes in the array, determine whether each shape is a TwoDimensionalShape or a ThreeDimensionalShape. If a shape is a TwoDimensionalShape, display its area. If a shape is a ThreeDimensionalShape, display its area and volume.
please use the below requirement when doing the code
PROCESSING LOGIC
The processing should be defined by summarizing the control and data flow within the
main
Language, Pseudo Code and Flow Charts.
The main program flow must be supplemented with the flow of
subroutines/methods/functions that are called from the main program.
Any specific
DATA (INPUT/OUTPUT)
The logical and physical data structure of files should be defined in detail. Data
structure definitions must include the:
a. description of each element, e.g. name, type, dimension;
b. relationships between the elements, i.e. the structure and source;
c. range of possible values of each element;
d. initial values of each element.
COMPONENTS (SOURCE CODE NAMES, CLASSES, METHODS)
Describe the software components (names or classes) and purpose that will be used.
Include UML class diagram showing the properties and methods of the class.
Describe the properties of the class and any constraints upon their value.
Indicate where the algorithms defined in processing logic are implemented.
TESTING
Present one or more named scenarios including the input data, expected output and
the success criteria desired that will be utilized to test the application. The testing
plan should be repeatable so discuss any ‘clean up’ that might be required to do so.
Example Scenario 1 – divide by zero test
Steps to test
Enter zero in the divisor.
Expected reaction
Expected results is a message saying ‘Zero is not a valid input. Please try
again’.
Program Approach :
This C# program is an example of object-oriented programming, specifically the use of abstract classes and inheritance. The program defines an abstract base class Shape
, and two abstract classes TwoDimensionalShape
and ThreeDimensionalShape
that inherit from Shape
. It also defines four concrete classes Circle
, Square
, Sphere
, and Cube
that inherit from either TwoDimensionalShape
or ThreeDimensionalShape
.
Each of the concrete classes implements the required abstract methods from its parent class. Circle
and Square
both inherit from TwoDimensionalShape
and implement the Area
property, while Sphere
and Cube
both inherit from ThreeDimensionalShape
and implement the Area
and Volume
properties.
In the Main
method, an array of Shape
objects is created, and each element in the array is assigned a concrete class instance. A loop iterates over each element in the array, and for each element, its description is printed to the console. If the element is an instance of TwoDimensionalShape
, its area is also printed to the console. If the element is an instance of ThreeDimensionalShape
, both its area and volume are printed to the console.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 4 images