Question: Write a console application 1. Simple Inheritance example with Base class as Shape which has width and height. Derive a class Rectangle, which has a
Write a console application
1. Simple Inheritance example with Base class as Shape which has width and height.
Derive a class Rectangle, which has a method GetArea().
2. Interface example,
a. Create Interface ISample with a method name GetArea with parameters Length and width and return INT,
b. Implement ISample in DemoInterface class and implement GetArea method.
c. Create Box class which has Main method will have an instance of the DemoInterface class and call the method.
3. Similarly, implement the above example using abstract class instead of an Interface.
4. Encapsulation concept related example covering all access modifiers.
For reference:https://www.c-sharpcorner.com/article/encapsulation-in-C-Sharp/
5. Polymorphism related Exercise.
a. Method/Function Overloading and Overriding example.
b. Operator Overloading and Overriding example.
c. Example using Override and virtual keywords.
6. Find the volume of the box class example provided:
A. Using Default constructor
B. Using Parameterized constructor
C. Using function volume call.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
