Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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