Lecture 1
Lecture 1
➢Several programming language supports the programming paradigm OOP, such as Java
and C#.
➢The programming paradigm is one of the styles of programming that is used to develop
software systems.
➢In the object-oriented paradigm, a template for a collection of objects is called a class.
Object-Oriented Programming (OOP)
Object-Oriented Programming is a methodology to build software
systems.
Course
Teacher Section Hall
Example:
Data Functions ()
1-Student-name 1- change-study-level()
2-Address 2- print-student-name()
3-GPA 3-print-student-
4-ID address()
5- Study-level 4- modify-GPA()
Product
Data
Functions ()
1-product name
1- Discount
2-Product-code
2- Print-Product name()
3-Price
3-Print-product-price()
4-Discount rate
4- modify-price()
5-Producer
The main steps to develop each system are by
using the OOP paradigm.
Step 1: Determine the objects that we need in the developed
system.
Step 2: Determine the set of attributes for each object.
Step 3: Determine the set of operations.
Example:
Implement a simple C++ program using the following steps :
1)Define a class GradeBook with a member function displayMessage.
This function prints a message on the screen "welcome to the grade-
book program".
2)Create a GradeBook object named myGradeBook and call its member
function in the main function of the program.
Example
Class Declarations
// x is declared to be an object of the Ratio class
Outputs