SCHOOL OF EE-ECE-COE
ADVANCED OBJECT ORIENTED PROGRAMMING
DRILL #5
NAME
:
______________________________
COURSE :
______________________________
SECTION :
______________________________
DATE OF PERFORMANCE :
________________
DATE OF SUBMISSION
:
________________
_______________________________________
PROFESSOR
Advanced Programming using Visual Studio C#
1
Programming Drill No. 5
Advanced Object Oriented Programming
OBJECTIVES:
1.
To learn the four major features of object-oriented languages
2.
To apply inheritance to enable reusing of user-defined classes 3.
To create classes than can be compiled and stored as dynamic link library (DLL) file and then referenced by any other applications.
4.
To design a window application that will exhibit the features of object oriented languages.
DISCUSSION:
A true object-oriented programming (OOP) language supports the four major concepts, namely;
1. ABSTRACTION - identifies and determines the objects needed for the design
2. ENCAPSULATION - packages data attributes and behaviors into a single unit but still hide implementation details
3. INHERITANCE - enables reuse of code by extending the functionality of the program units
4. POLYMORPHISM - allows multiple implementations though an appropriate implementation can be executed based on the situation. In inheritance, a general class, which is also named as the base class, can be created and with the use of accessor/mutators or properties, the data members can be accessed. There is another specialized class called derived class that inherits the data members of the base class and extends its functionality by adding their own unique data and behaviors. Below is an example of a base class named
Employee with three data members and the implementation of the
Employee class with the use of a derived class named Regular.
Advanced Programming using Visual Studio C#
2
public class