Вы находитесь на странице: 1из 8

DFC 3013 OBJECT ORIENTED PROGRAMMING

WORKBOOK ACTIVITY
ANSWER SCHEME
(Lab Exercise 1)

Page 1 of 8

DFC 3013 OBJECT ORIENTED PROGRAMMING

Page 2 of 8

DFC 3013 OBJECT ORIENTED PROGRAMMING

ACTIVITY 1: Introduction to C++ Programming


Duration: 2 Hours
Learning Outcomes
This Labsheet encompasses activities 1A, 1B, 1C, 1D,1E and 1F
By the end of this lab, students should be able to :
Illustrate the basic terminologies of OOP: Classes, Object, Encapsulation, Data Abstraction,
Inheritance and Polymorphism.
Distinguish between abstraction and encapsulation

Activity 1A
Activity Outcome: Illustrate the basic terminologies of OOP: Classes
Procedure:
Step 1: Based on below Car class figure, identify class, object and it relationship with attributes
and method.
Step 2: Fill in the identification output in designated blank space.

Page 3 of 8

DFC 3013 OBJECT ORIENTED PROGRAMMING

Activity 1B
Activity Outcome: Illustrate the basic terminologies of OOP: Object
Procedure:
Step 1: Based on below MyCar object from class Car, identify object and it relationship with
attributes and method.
Step 2: Fill in the identification output in designated blank space.

Activity 1C
Activity Outcome: Illustrate the basic terminologies of OOP: Classes and Object
Procedure:
Step 1: By using concept of class and object in OOP, illustrate Class Phone and Object
MyPhone by including it relationship with attributes and method.
Step 2: Put both Class Phone and Object MyPhone into figure diagram as of Activity 1A and
1B.
Step 3: Share and present the outcome of Class Phone and Object MyPhone

Page 4 of 8

DFC 3013 OBJECT ORIENTED PROGRAMMING

Activity 1D
Activity Outcome: Illustrate the basic terminologies of OOP: Encapsulation, Data Abstraction,
Inheritance and Polymorphism.
Procedure:
Step 1:
Step 2:
Step 3:
Step 4:

Define the 4 basic concept of OOP.


List down advantages of each concept
Give real example of each of the concept.
Fill in the output in the table provided below.

OOP Concept

Definition

Benefits

Real World Example

Encapsulation

Data
Abstraction
Inheritance

Polymorphism

Page 5 of 8

DFC 3013 OBJECT ORIENTED PROGRAMMING

Activity 1E
Activity Outcome: Illustrate the basic terminologies of OOP: Encapsulation, Inheritance and
Polymorphism.
Procedure:
Step 1: Identify 3 OOP terminologies based on figure below
Step 4: Fill in the output in the blank space provided below.

a.

Page 6 of 8

DFC 3013 OBJECT ORIENTED PROGRAMMING

b.

c.

Page 7 of 8

DFC 3013 OBJECT ORIENTED PROGRAMMING

Activity 1F
Activity Outcome: Distinguish between abstraction and encapsulation
Group Discussion Procedure:
Step 1: List down the different between Abstraction and Encapsulation in Object Oriented
Programming.
Step 2: Fill in the output in the table provided below.
Step 3: A representative (selected by the lecturer) from each group will present their sharing

Abstraction

Encapsulation

Page 8 of 8

Вам также может понравиться