Lab 1A: Introduction To Object Oriented Programming (Oop) : Duration: 2 Hours Learning Outcomes
Lab 1A: Introduction To Object Oriented Programming (Oop) : Duration: 2 Hours Learning Outcomes
PROGRAMMING (OOP)
Duration : 2 hours
Learning Outcomes
SCENARIO:
Miss Lin, manager of IT department at Ipoh View College, wants a new
information system to support their current and future business operations.
Therefore, with the supervision of Miss Lin has given you the task to
develop examination system by using Java program. Your task is to
convince Miss Lin that you are familiar with Object Oriented Programming
concepts and terminologies before you proceed to develop examination
system.
Activity 1
Procedure:
Step 1 : Based on below Student class figure, identify class, object and it
relationship with attributes and method.
Step 2 : Fill in the identification output in designated blank space.
1
Student 1. Class
• Name
• RegNum
• IC
• Tel Attribute/
2. data / properties
• Email
• Address
• Section
• InputData ()
• RegisterCourse ()
• InputMark () Operation
3. / behaviour / method
• DisplayInfo ()
• DisplayResult ()
Activity 2
Procedure:
Step 1 : Based on below StudInfo object from class Student, identify object
and it relationship with attributes and method.
Step 2 : Fill in the identification output in designated blank space.
2
StudInfo 1. An object
• Nurina Abdullah
• 01DDT15F1122
• 900123085643
• 012-6578343 2. Attribute
• [email protected]
• Taman Cempaka
• DIS3A
• InputData()
• RegisterCourse() 3. Operation
• InputMark()
• DisplayInfo()
• DisplayResult()
Activity 3
Procedure:
Step 1 : By using concept of class and object in OOP, illustrate Class
Course and Object MyCourse by including it relationship with attributes
and method.
Step 2 : Put both Class Course and Object MyCourse into figure diagram
as of Activity 1A and 1B.
Step 3 : Share and present the outcome of Class Course and Object
MyCourse.
3
Activity 4
Procedure:
Step 1 : Identify 3 OOP terminologies based on figure
below Step 2 : Fill in the output in the blank space
provided below.
a.
4
b.
5
c.
6
Activity 5
Procedure:
Step 1 : Define the 4 basic concept of OOP.
Step 2 : List down advantages of each concept
Step 3 : Give real example of each of the concept.
Step 4 : Fill in the output in the table provided below.
Real World
OOP Concept Definition Advantages
Example
refers to the
Encapsulation
bundling of data School bag is
allows modifying
with the methods one of the most
implemented
that operate on that real examples of
code without
Encapsulation data, or the Encapsulation.
breaking other
restricting of direct School bag can
code who have
access to some of keep our books,
implemented the
an object's pens, etc.
code
components.
ATM Machine;
All are
performing
operations on the
ATM machine
Is the separation
like cash
between the Helps the user to
Data withdrawal,
specification of a avoid writing the
Abstraction money transfer,
data object and its low level code.
retrieve mini-
implementation
statement…etc.
but we can't
know internal
details about
ATM.in
Inheritance Is the process of code reusability The class 'Car'
7
inherits its
properties from
the class
forming a new 'Automobiles'
class from an which inherits
existing some of its
properties from
another class
'Vehicles'.
Is a process of
giving the same A person
message to two or behaves the son
more different Reduces in a house at the
Polymorphis objects and coupling same time that
m produce different between different the person
behaviours functionalities behaves an
depending on how employee in an
the objects receive office.
the mesaage