Documente Academic
Documente Profesional
Documente Cultură
THEORY
describe an object.
4 Main concepts of
OOP
Polymorphism: Polymorphism is
ACTIVITY 1
Procedure:
Look at the output from application below.The applicaion can accept the data given by
the user (name, regs. No, course and mark), then there are other functions to calculate
the gred depend on the mark. At last the information will display like below :
Name:
Regs. Number :
Course :
Mark:
Gred:
Object
: Student
Data
Method : Accept()
Calculate()
Display()
EXERCISE
1.
Table below show all the information about staff in Guiuan Shopping Center.
Staff_No
Name
Gender
IC NO
Address
Telephone.No
Start
Working(Year)
A0410
Joey De Leon
750514-02-5843
No.1 Jalan
Batu
Berendam,
Melaka
014-2233678
2000
A8092
Vic Sotto
681223-03-5777
PT 32, Jalan
Kemaman,
Kuala Lumpur
0135678999
1994
Create an application to accept all the data as show in the information above. Other
than that, there are other functions to calculate the total years working and display all
the information like:
Name:
Joey De Leon
Start Working: 2000
Total year:
9
2.
Using data abstraction, take out all the data and functions that are needed to create this
application.
Object
: ____________________
Data
: ________________________________________________________
Method : ____________________
____________________
____________________
Use the data encapsulation concept to gather all the data and appropriate functions into the
class.
______________________
{
__________________
__________________
__________________
__________________
__________________
__________________
__________________
Public:
_______________ ( );
_______________( );
_______________ ( );
};
NOTES
______________________________________________________________________
______________________________________________________________________
______________________________________________________________________
______________________________________________________________________
______________________________________________________________________
______________________________________________________________________
______________________________________________________________________
______________