Mahmoud Rafeek Alfarra
Computer Programming ||
Chapter 1: Introduction & OOP
Contents
Principles of OOP
Evaluation
Syllabus
Description of course
About Lecturer
www.cst.ps/staff/mfarra www.facebook.com/mahmoudRfarra
2
Practice of (Array of students)
Project of (Array of cars)
About LecturerAbout Lecturer
Mahmoud Rafeek Alfarra Certificates:
MSc Computer Science,2008, Pattern Recognition, AAST, Alexandria, Egypt. BSc Computer Science,2004, The Islamic University of Gaza, Palestine.
Currently : Head Of Continuing Education and Community Service (CECS) department. Lecturer in Computer Science & Information Technology (CSIT) department. Board member of PICTA
Past: Head Computer Science & Information Technology (CSIT) department in CST (9-
2012 To 9-2013). Head Of Computer Center in CST (9-2009 To 10-2010) Head of ITF1, ITF2 and ITF3 Lecturer in QOU, UP, CST and UCAS as Part Time
Contacts: E-mail: [email protected] Site: http://www.cst.ps/staff/mfarra YouTube channel: mralfarra1 FaceBook Page: mahmoudRfarra
www.cst.ps/staff/mfarra www.facebook.com/mahmoudRfarra
3
SyllabusSyllabus
Revision of OOP Exception Handling String manipulation Regular expression Files and Streams Connect applications with DBMS Streams-Based Sockets and Datagrams
www.cst.ps/staff/mfarra www.facebook.com/mahmoudRfarra
4
EvaluationEvaluationwww.cst.ps/staff/mfarra www.facebook.com/mahmoudRfarra
5
Principles of OOPPrinciples of OOP
To have a fine definition of OOP, Please note what you are showing in your class
room now? Nice, what is the properties and behavior
of each of them ? This is the OOP style.
www.cst.ps/staff/mfarra www.facebook.com/mahmoudRfarra
6
ChairsTables Teacher
PCs..
ChairsTables Teacher
PCs..
# of legs
Type of material
Color
.
.
.
# of legs
Type of material
Color
.
.
.
Principles of OOPPrinciples of OOPwww.cst.ps/staff/mfarra www.facebook.com/mahmoudRfarra
7
OOP
Principles of OOPPrinciples of OOP
Class & Object In your class room there is … tables,
chairs, students. Each one of them is object from class.
www.cst.ps/staff/mfarra www.facebook.com/mahmoudRfarra
8
Principles of OOPPrinciples of OOPwww.cst.ps/staff/mfarra www.facebook.com/mahmoudRfarra
9
Any Thing
Attributes
Behavior
Each one is presented as a variable in the Class
Each one is presented as a variable in the Class
Each one is presented as a method in the Class
Each one is presented as a method in the Class
Principles of OOPPrinciples of OOPwww.cst.ps/staff/mfarra www.facebook.com/mahmoudRfarra
10
Access_modifiers class class_name {// variables = attributes Access_modifiers class_name() {
}// behavior = methods
}
Access_modifiers class class_name {// variables = attributes Access_modifiers class_name() {
}// behavior = methods
}
Always, the class has a method called constructorwhich gives initial values to the attributes of class
Is a reserved word
The identifier of class Must be as any variable
Practice of (Array of students)Practice of (Array of students)www.cst.ps/staff/mfarra www.facebook.com/mahmoudRfarra
11
StudentStudent
NameIdGPACourse[,]
NameIdGPACourse[,]
addCourseinfocalcGpa…
addCourseinfocalcGpa…
Array of StudentArray of Student
Project of (car park)Project of (car park)www.cst.ps/staff/mfarra www.facebook.com/mahmoudRfarra
12
CarCar
NameIdModelPriceLoginLogout
NameIdModelPriceLoginLogout
CalcPeriodCalcFareinfo…
CalcPeriodCalcFareinfo…
Car parkCar park
…..…..
……
attributes
beha
vior
Join the discussion on Sunday 6.10.2013
Mahmoud Rafeek Alfarra