SlideShare a Scribd company logo
OBJECT ORIENTED PROGRAMMING
Suman Saikan
Lecturer
Dept. of CSE
Dhaka International University
1
Sunday, June 25, 2023
DEFINITION OF OBJECT ORIENTED PROGRAMMING
Object-Oriented Programming or OOPs refers to
languages that use objects in programming. Object-
oriented programming aims to implement real-world
entities like inheritance, hiding, polymorphism, etc
in programming. The main aim of OOP is to bind
together the data and the functions that operate on
them so that no other part of the code can access
this data except that function.
2
WHAT ARE THE CONCEPTS OF OOP
 Class
 Objects
 Data Abstraction
 Encapsulation
 Inheritance
 Polymorphism
 Dynamic Binding
 Message Passing
Main Features of OOP
3
COMPARE BETWEEN ABSTRACTION AND ENCAPSULATION
4
DISTINGUISH BETWEEN STRUCTURE PROGRAMMING AND
OBJECT ORIENTED PROGRAMMING
5
DESCRIBE DIFFERENT KINDS OF LOOP WITH EXAMPLE
 Loops in programming are used to repeat a block of
code until the specified condition is met. A loop
statement allows programmers to execute a
statement or group of statements multiple times
without repetition of code.
6
For Loop
for loop in C programming is a repetition control
structure that allows programmers to write a loop
that will be executed a specific number of times.
for loop enables programmers to perform n
number of steps together in a single line.
Syntax:
for (initialize expression; test expression; increment)
{
// // body of for loop // ;
}
7
While Loop
While loop does not depend upon the number of
iterations. In for loop the number of iterations was
previously known to us but in the While loop, the
execution is terminated on the basis of the test
condition. If the test condition will become false then it
will break from the while loop else body will be
executed.
Syntax:
initialization_expression;
while (test_expression)
{
// body of the while loop update_expression;
}
8
do-while Loop
The do-while loop is similar to a while loop but the only difference lies in the do-
while loop test condition which is tested at the end of the body. In the do-while
loop, the loop body will execute at least once irrespective of the test condition.
Syntax:
initialization_expression;
do {
// body of do-while loop update_expression;
} while (test_expression);
9
ILLUSTRATE RECURSION IN STRUCTURE PROGRAMMING
Recursion is the technique of making a function call itself. This
technique provides a way to break complicated problems
down into simple problems which are easier to solve.
10
DIFFERENCE BETWEEN METHOD OVERLOADING AND
METHOD OVERRIDING
11
WRITE A C++ PROGRAM TO CALCULATE FACTORIAL OF
ANY INTEGER
12
DISTINGUISH BETWEEN POST INCREMENT AND
PRE INCREMENT
13
FIND ERROR AND SOLVE IT IN C++
Problem:
 #include <Iostream>
 int main()
 {
 int a=2;
 if(A>1)

 Cout<<"a is greater than 1")
 return 0;
 }
Solution:
 #include <iostream>
 int main()
 {
 int a=2;
 if(a>1)

 cout<<("a is greater than 1");
 return 0;
 }
14
EXPLAIN THE OUTPUT OF THIS C++ PROGRAM:
#include <iostream>
using namespace std;
int main() {
for (int i = 0; i < 10; i++)
{
if (i == 4) {
continue;
}
cout << i << "n";
}
return 0;
} 15
WRITE THE OUTPUT OF THIS FOLLOWING CODE
#include<iostream>
using namespace std;
void main()
{
int y=10;
if(y++>9 && y++!=10 && y++>11)
cout<<y<<endl;
else
cout<<y<< endl;
}
16
17

More Related Content

Similar to Question Pattern in Object Oriented Programming

Password protected diary
Password protected diaryPassword protected diary
Password protected diary
SHARDA SHARAN
 
Object Oriented Concepts and Principles
Object Oriented Concepts and PrinciplesObject Oriented Concepts and Principles
Object Oriented Concepts and Principles
deonpmeyer
 
babsatu-140703233001-phpapp666666601.pdf
babsatu-140703233001-phpapp666666601.pdfbabsatu-140703233001-phpapp666666601.pdf
babsatu-140703233001-phpapp666666601.pdf
kashafishfaq21
 
1669609053088_oops_final.pptx
1669609053088_oops_final.pptx1669609053088_oops_final.pptx
1669609053088_oops_final.pptx
PandeeswariKannan
 
Loops
LoopsLoops
Basic concept of OOP's
Basic concept of OOP'sBasic concept of OOP's
Basic concept of OOP's
Prof. Dr. K. Adisesha
 
Interoduction to c++
Interoduction to c++Interoduction to c++
Interoduction to c++
Amresh Raj
 
Mark asoi ppt
Mark asoi pptMark asoi ppt
Mark asoi pptmark-asoi
 
Twins: OOP and FP
Twins: OOP and FPTwins: OOP and FP
Twins: OOP and FP
RichardWarburton
 
Making an Exception
Making an ExceptionMaking an Exception
Making an Exception
Kevlin Henney
 
Object Oriented Programming
Object Oriented ProgrammingObject Oriented Programming
Programming topics. syed arslan rizvi
Programming topics. syed arslan rizviProgramming topics. syed arslan rizvi
Programming topics. syed arslan rizviSyed Arslan Rizvi
 
PCCF UNIT 2.pptx
PCCF UNIT 2.pptxPCCF UNIT 2.pptx
PCCF UNIT 2.pptx
DivyaKS12
 
INTRODUCTION TO JAVA
INTRODUCTION TO JAVAINTRODUCTION TO JAVA
INTRODUCTION TO JAVA
RAMALINGHAM KRISHNAMOORTHY
 
LOOPING_STATEMENT c++ pptx from bgctub university
LOOPING_STATEMENT c++ pptx from bgctub universityLOOPING_STATEMENT c++ pptx from bgctub university
LOOPING_STATEMENT c++ pptx from bgctub university
jebinchowdhury68
 
Tortuga-A simulation software
Tortuga-A simulation softwareTortuga-A simulation software
Tortuga-A simulation software
Syeda Nyma
 

Similar to Question Pattern in Object Oriented Programming (20)

OOP java
OOP javaOOP java
OOP java
 
Password protected diary
Password protected diaryPassword protected diary
Password protected diary
 
Object Oriented Concepts and Principles
Object Oriented Concepts and PrinciplesObject Oriented Concepts and Principles
Object Oriented Concepts and Principles
 
Bab satu
Bab satuBab satu
Bab satu
 
babsatu-140703233001-phpapp666666601.pdf
babsatu-140703233001-phpapp666666601.pdfbabsatu-140703233001-phpapp666666601.pdf
babsatu-140703233001-phpapp666666601.pdf
 
1669609053088_oops_final.pptx
1669609053088_oops_final.pptx1669609053088_oops_final.pptx
1669609053088_oops_final.pptx
 
Training 8051Report
Training 8051ReportTraining 8051Report
Training 8051Report
 
Loops
LoopsLoops
Loops
 
Basic concept of OOP's
Basic concept of OOP'sBasic concept of OOP's
Basic concept of OOP's
 
Interoduction to c++
Interoduction to c++Interoduction to c++
Interoduction to c++
 
Mark asoi ppt
Mark asoi pptMark asoi ppt
Mark asoi ppt
 
Twins: OOP and FP
Twins: OOP and FPTwins: OOP and FP
Twins: OOP and FP
 
Loops
LoopsLoops
Loops
 
Making an Exception
Making an ExceptionMaking an Exception
Making an Exception
 
Object Oriented Programming
Object Oriented ProgrammingObject Oriented Programming
Object Oriented Programming
 
Programming topics. syed arslan rizvi
Programming topics. syed arslan rizviProgramming topics. syed arslan rizvi
Programming topics. syed arslan rizvi
 
PCCF UNIT 2.pptx
PCCF UNIT 2.pptxPCCF UNIT 2.pptx
PCCF UNIT 2.pptx
 
INTRODUCTION TO JAVA
INTRODUCTION TO JAVAINTRODUCTION TO JAVA
INTRODUCTION TO JAVA
 
LOOPING_STATEMENT c++ pptx from bgctub university
LOOPING_STATEMENT c++ pptx from bgctub universityLOOPING_STATEMENT c++ pptx from bgctub university
LOOPING_STATEMENT c++ pptx from bgctub university
 
Tortuga-A simulation software
Tortuga-A simulation softwareTortuga-A simulation software
Tortuga-A simulation software
 

More from Suman Mia

Computer Network Topology By Team_Initiator (Dept . of Sociology)
Computer Network Topology By Team_Initiator (Dept . of Sociology)Computer Network Topology By Team_Initiator (Dept . of Sociology)
Computer Network Topology By Team_Initiator (Dept . of Sociology)
Suman Mia
 
Computer Network Topology By Team_Diversity Detectives (Dept . of Sociology)
Computer Network Topology By Team_Diversity Detectives (Dept . of Sociology)Computer Network Topology By Team_Diversity Detectives (Dept . of Sociology)
Computer Network Topology By Team_Diversity Detectives (Dept . of Sociology)
Suman Mia
 
Computer Network Topology By Team_Societal Explorers (Dept . of Sociology)
Computer Network Topology By Team_Societal Explorers (Dept . of Sociology)Computer Network Topology By Team_Societal Explorers (Dept . of Sociology)
Computer Network Topology By Team_Societal Explorers (Dept . of Sociology)
Suman Mia
 
Computer Network Topology By Team_Social Dynamic Squad (Dept . of Sociology)
Computer Network Topology By Team_Social Dynamic Squad (Dept . of Sociology)Computer Network Topology By Team_Social Dynamic Squad (Dept . of Sociology)
Computer Network Topology By Team_Social Dynamic Squad (Dept . of Sociology)
Suman Mia
 
Computer Network Topology By Team_Inclusion Inquiry Initiative (Dept . of Soc...
Computer Network Topology By Team_Inclusion Inquiry Initiative (Dept . of Soc...Computer Network Topology By Team_Inclusion Inquiry Initiative (Dept . of Soc...
Computer Network Topology By Team_Inclusion Inquiry Initiative (Dept . of Soc...
Suman Mia
 
Computer Network Topology By Team_Culture Crusade (Dept . of Sociology)
Computer Network Topology By Team_Culture Crusade (Dept . of Sociology)Computer Network Topology By Team_Culture Crusade (Dept . of Sociology)
Computer Network Topology By Team_Culture Crusade (Dept . of Sociology)
Suman Mia
 
Computer Network Topology By Team_Community Connectors (Dept . of Sociology)
Computer Network Topology By Team_Community Connectors (Dept . of Sociology)Computer Network Topology By Team_Community Connectors (Dept . of Sociology)
Computer Network Topology By Team_Community Connectors (Dept . of Sociology)
Suman Mia
 
Computer Network Topology By Team_Empowerment Ensemble (Dept . of Sociology)
Computer Network Topology By Team_Empowerment Ensemble (Dept . of Sociology)Computer Network Topology By Team_Empowerment Ensemble (Dept . of Sociology)
Computer Network Topology By Team_Empowerment Ensemble (Dept . of Sociology)
Suman Mia
 
Computer Network Topology By Team_Venus(Dept. English)
Computer Network Topology By Team_Venus(Dept. English)Computer Network Topology By Team_Venus(Dept. English)
Computer Network Topology By Team_Venus(Dept. English)
Suman Mia
 
Computer Network Topology By Team_Triangle(Dept. English)
Computer Network Topology By Team_Triangle(Dept. English)Computer Network Topology By Team_Triangle(Dept. English)
Computer Network Topology By Team_Triangle(Dept. English)
Suman Mia
 
Computer Network Topology By Team_Royal (Dept. English)
Computer Network Topology By Team_Royal (Dept. English)Computer Network Topology By Team_Royal (Dept. English)
Computer Network Topology By Team_Royal (Dept. English)
Suman Mia
 
Computer Network Topology By Team_Sanam (Dept. English)
Computer Network Topology By Team_Sanam (Dept. English)Computer Network Topology By Team_Sanam (Dept. English)
Computer Network Topology By Team_Sanam (Dept. English)
Suman Mia
 
Computer Network Topology By Team_Purple (Dept. English)
Computer Network Topology By Team_Purple (Dept. English)Computer Network Topology By Team_Purple (Dept. English)
Computer Network Topology By Team_Purple (Dept. English)
Suman Mia
 
Computer Network Topology By Team_ Paramount (Dept. English)
Computer Network Topology By Team_ Paramount (Dept. English)Computer Network Topology By Team_ Paramount (Dept. English)
Computer Network Topology By Team_ Paramount (Dept. English)
Suman Mia
 
Computer Network Topology By Team_Metrolife(Dept. English)
Computer Network Topology By Team_Metrolife(Dept. English)Computer Network Topology By Team_Metrolife(Dept. English)
Computer Network Topology By Team_Metrolife(Dept. English)
Suman Mia
 
Computer Network Topology By Team_Meghna (Dept. English)
Computer Network Topology By Team_Meghna (Dept. English)Computer Network Topology By Team_Meghna (Dept. English)
Computer Network Topology By Team_Meghna (Dept. English)
Suman Mia
 
Computer Network Topology By Team_Jamuna (Dept. English)
Computer Network Topology By Team_Jamuna (Dept. English)Computer Network Topology By Team_Jamuna (Dept. English)
Computer Network Topology By Team_Jamuna (Dept. English)
Suman Mia
 
Computer Network Topology By Team_CSK (Dept. English)
Computer Network Topology By Team_CSK (Dept. English)Computer Network Topology By Team_CSK (Dept. English)
Computer Network Topology By Team_CSK (Dept. English)
Suman Mia
 
COmputer Network Topology By Team Gemini
COmputer Network Topology By Team GeminiCOmputer Network Topology By Team Gemini
COmputer Network Topology By Team Gemini
Suman Mia
 
Software Development Life Cycle(SDLC) By Team Hunter (Dept. of Pharmacy)
Software Development Life Cycle(SDLC) By Team Hunter (Dept. of Pharmacy)Software Development Life Cycle(SDLC) By Team Hunter (Dept. of Pharmacy)
Software Development Life Cycle(SDLC) By Team Hunter (Dept. of Pharmacy)
Suman Mia
 

More from Suman Mia (20)

Computer Network Topology By Team_Initiator (Dept . of Sociology)
Computer Network Topology By Team_Initiator (Dept . of Sociology)Computer Network Topology By Team_Initiator (Dept . of Sociology)
Computer Network Topology By Team_Initiator (Dept . of Sociology)
 
Computer Network Topology By Team_Diversity Detectives (Dept . of Sociology)
Computer Network Topology By Team_Diversity Detectives (Dept . of Sociology)Computer Network Topology By Team_Diversity Detectives (Dept . of Sociology)
Computer Network Topology By Team_Diversity Detectives (Dept . of Sociology)
 
Computer Network Topology By Team_Societal Explorers (Dept . of Sociology)
Computer Network Topology By Team_Societal Explorers (Dept . of Sociology)Computer Network Topology By Team_Societal Explorers (Dept . of Sociology)
Computer Network Topology By Team_Societal Explorers (Dept . of Sociology)
 
Computer Network Topology By Team_Social Dynamic Squad (Dept . of Sociology)
Computer Network Topology By Team_Social Dynamic Squad (Dept . of Sociology)Computer Network Topology By Team_Social Dynamic Squad (Dept . of Sociology)
Computer Network Topology By Team_Social Dynamic Squad (Dept . of Sociology)
 
Computer Network Topology By Team_Inclusion Inquiry Initiative (Dept . of Soc...
Computer Network Topology By Team_Inclusion Inquiry Initiative (Dept . of Soc...Computer Network Topology By Team_Inclusion Inquiry Initiative (Dept . of Soc...
Computer Network Topology By Team_Inclusion Inquiry Initiative (Dept . of Soc...
 
Computer Network Topology By Team_Culture Crusade (Dept . of Sociology)
Computer Network Topology By Team_Culture Crusade (Dept . of Sociology)Computer Network Topology By Team_Culture Crusade (Dept . of Sociology)
Computer Network Topology By Team_Culture Crusade (Dept . of Sociology)
 
Computer Network Topology By Team_Community Connectors (Dept . of Sociology)
Computer Network Topology By Team_Community Connectors (Dept . of Sociology)Computer Network Topology By Team_Community Connectors (Dept . of Sociology)
Computer Network Topology By Team_Community Connectors (Dept . of Sociology)
 
Computer Network Topology By Team_Empowerment Ensemble (Dept . of Sociology)
Computer Network Topology By Team_Empowerment Ensemble (Dept . of Sociology)Computer Network Topology By Team_Empowerment Ensemble (Dept . of Sociology)
Computer Network Topology By Team_Empowerment Ensemble (Dept . of Sociology)
 
Computer Network Topology By Team_Venus(Dept. English)
Computer Network Topology By Team_Venus(Dept. English)Computer Network Topology By Team_Venus(Dept. English)
Computer Network Topology By Team_Venus(Dept. English)
 
Computer Network Topology By Team_Triangle(Dept. English)
Computer Network Topology By Team_Triangle(Dept. English)Computer Network Topology By Team_Triangle(Dept. English)
Computer Network Topology By Team_Triangle(Dept. English)
 
Computer Network Topology By Team_Royal (Dept. English)
Computer Network Topology By Team_Royal (Dept. English)Computer Network Topology By Team_Royal (Dept. English)
Computer Network Topology By Team_Royal (Dept. English)
 
Computer Network Topology By Team_Sanam (Dept. English)
Computer Network Topology By Team_Sanam (Dept. English)Computer Network Topology By Team_Sanam (Dept. English)
Computer Network Topology By Team_Sanam (Dept. English)
 
Computer Network Topology By Team_Purple (Dept. English)
Computer Network Topology By Team_Purple (Dept. English)Computer Network Topology By Team_Purple (Dept. English)
Computer Network Topology By Team_Purple (Dept. English)
 
Computer Network Topology By Team_ Paramount (Dept. English)
Computer Network Topology By Team_ Paramount (Dept. English)Computer Network Topology By Team_ Paramount (Dept. English)
Computer Network Topology By Team_ Paramount (Dept. English)
 
Computer Network Topology By Team_Metrolife(Dept. English)
Computer Network Topology By Team_Metrolife(Dept. English)Computer Network Topology By Team_Metrolife(Dept. English)
Computer Network Topology By Team_Metrolife(Dept. English)
 
Computer Network Topology By Team_Meghna (Dept. English)
Computer Network Topology By Team_Meghna (Dept. English)Computer Network Topology By Team_Meghna (Dept. English)
Computer Network Topology By Team_Meghna (Dept. English)
 
Computer Network Topology By Team_Jamuna (Dept. English)
Computer Network Topology By Team_Jamuna (Dept. English)Computer Network Topology By Team_Jamuna (Dept. English)
Computer Network Topology By Team_Jamuna (Dept. English)
 
Computer Network Topology By Team_CSK (Dept. English)
Computer Network Topology By Team_CSK (Dept. English)Computer Network Topology By Team_CSK (Dept. English)
Computer Network Topology By Team_CSK (Dept. English)
 
COmputer Network Topology By Team Gemini
COmputer Network Topology By Team GeminiCOmputer Network Topology By Team Gemini
COmputer Network Topology By Team Gemini
 
Software Development Life Cycle(SDLC) By Team Hunter (Dept. of Pharmacy)
Software Development Life Cycle(SDLC) By Team Hunter (Dept. of Pharmacy)Software Development Life Cycle(SDLC) By Team Hunter (Dept. of Pharmacy)
Software Development Life Cycle(SDLC) By Team Hunter (Dept. of Pharmacy)
 

Recently uploaded

Water billing management system project report.pdf
Water billing management system project report.pdfWater billing management system project report.pdf
Water billing management system project report.pdf
Kamal Acharya
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
manasideore6
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
PPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testingPPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testing
anoopmanoharan2
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
SyedAbiiAzazi1
 
Self-Control of Emotions by Slidesgo.pptx
Self-Control of Emotions by Slidesgo.pptxSelf-Control of Emotions by Slidesgo.pptx
Self-Control of Emotions by Slidesgo.pptx
iemerc2024
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
awadeshbabu
 
TOP 10 B TECH COLLEGES IN JAIPUR 2024.pptx
TOP 10 B TECH COLLEGES IN JAIPUR 2024.pptxTOP 10 B TECH COLLEGES IN JAIPUR 2024.pptx
TOP 10 B TECH COLLEGES IN JAIPUR 2024.pptx
nikitacareer3
 
Building Electrical System Design & Installation
Building Electrical System Design & InstallationBuilding Electrical System Design & Installation
Building Electrical System Design & Installation
symbo111
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
zwunae
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
Fundamentals of Induction Motor Drives.pptx
Fundamentals of Induction Motor Drives.pptxFundamentals of Induction Motor Drives.pptx
Fundamentals of Induction Motor Drives.pptx
manasideore6
 
AIR POLLUTION lecture EnE203 updated.pdf
AIR POLLUTION lecture EnE203 updated.pdfAIR POLLUTION lecture EnE203 updated.pdf
AIR POLLUTION lecture EnE203 updated.pdf
RicletoEspinosa1
 
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
zwunae
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Christina Lin
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
Kerry Sado
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
Rahul
 
digital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdfdigital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdf
drwaing
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
gestioneergodomus
 

Recently uploaded (20)

Water billing management system project report.pdf
Water billing management system project report.pdfWater billing management system project report.pdf
Water billing management system project report.pdf
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
PPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testingPPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testing
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
 
Self-Control of Emotions by Slidesgo.pptx
Self-Control of Emotions by Slidesgo.pptxSelf-Control of Emotions by Slidesgo.pptx
Self-Control of Emotions by Slidesgo.pptx
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
 
TOP 10 B TECH COLLEGES IN JAIPUR 2024.pptx
TOP 10 B TECH COLLEGES IN JAIPUR 2024.pptxTOP 10 B TECH COLLEGES IN JAIPUR 2024.pptx
TOP 10 B TECH COLLEGES IN JAIPUR 2024.pptx
 
Building Electrical System Design & Installation
Building Electrical System Design & InstallationBuilding Electrical System Design & Installation
Building Electrical System Design & Installation
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
Fundamentals of Induction Motor Drives.pptx
Fundamentals of Induction Motor Drives.pptxFundamentals of Induction Motor Drives.pptx
Fundamentals of Induction Motor Drives.pptx
 
AIR POLLUTION lecture EnE203 updated.pdf
AIR POLLUTION lecture EnE203 updated.pdfAIR POLLUTION lecture EnE203 updated.pdf
AIR POLLUTION lecture EnE203 updated.pdf
 
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
 
digital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdfdigital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdf
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
 

Question Pattern in Object Oriented Programming

  • 1. OBJECT ORIENTED PROGRAMMING Suman Saikan Lecturer Dept. of CSE Dhaka International University 1 Sunday, June 25, 2023
  • 2. DEFINITION OF OBJECT ORIENTED PROGRAMMING Object-Oriented Programming or OOPs refers to languages that use objects in programming. Object- oriented programming aims to implement real-world entities like inheritance, hiding, polymorphism, etc in programming. The main aim of OOP is to bind together the data and the functions that operate on them so that no other part of the code can access this data except that function. 2
  • 3. WHAT ARE THE CONCEPTS OF OOP  Class  Objects  Data Abstraction  Encapsulation  Inheritance  Polymorphism  Dynamic Binding  Message Passing Main Features of OOP 3
  • 4. COMPARE BETWEEN ABSTRACTION AND ENCAPSULATION 4
  • 5. DISTINGUISH BETWEEN STRUCTURE PROGRAMMING AND OBJECT ORIENTED PROGRAMMING 5
  • 6. DESCRIBE DIFFERENT KINDS OF LOOP WITH EXAMPLE  Loops in programming are used to repeat a block of code until the specified condition is met. A loop statement allows programmers to execute a statement or group of statements multiple times without repetition of code. 6
  • 7. For Loop for loop in C programming is a repetition control structure that allows programmers to write a loop that will be executed a specific number of times. for loop enables programmers to perform n number of steps together in a single line. Syntax: for (initialize expression; test expression; increment) { // // body of for loop // ; } 7
  • 8. While Loop While loop does not depend upon the number of iterations. In for loop the number of iterations was previously known to us but in the While loop, the execution is terminated on the basis of the test condition. If the test condition will become false then it will break from the while loop else body will be executed. Syntax: initialization_expression; while (test_expression) { // body of the while loop update_expression; } 8
  • 9. do-while Loop The do-while loop is similar to a while loop but the only difference lies in the do- while loop test condition which is tested at the end of the body. In the do-while loop, the loop body will execute at least once irrespective of the test condition. Syntax: initialization_expression; do { // body of do-while loop update_expression; } while (test_expression); 9
  • 10. ILLUSTRATE RECURSION IN STRUCTURE PROGRAMMING Recursion is the technique of making a function call itself. This technique provides a way to break complicated problems down into simple problems which are easier to solve. 10
  • 11. DIFFERENCE BETWEEN METHOD OVERLOADING AND METHOD OVERRIDING 11
  • 12. WRITE A C++ PROGRAM TO CALCULATE FACTORIAL OF ANY INTEGER 12
  • 13. DISTINGUISH BETWEEN POST INCREMENT AND PRE INCREMENT 13
  • 14. FIND ERROR AND SOLVE IT IN C++ Problem:  #include <Iostream>  int main()  {  int a=2;  if(A>1)   Cout<<"a is greater than 1")  return 0;  } Solution:  #include <iostream>  int main()  {  int a=2;  if(a>1)   cout<<("a is greater than 1");  return 0;  } 14
  • 15. EXPLAIN THE OUTPUT OF THIS C++ PROGRAM: #include <iostream> using namespace std; int main() { for (int i = 0; i < 10; i++) { if (i == 4) { continue; } cout << i << "n"; } return 0; } 15
  • 16. WRITE THE OUTPUT OF THIS FOLLOWING CODE #include<iostream> using namespace std; void main() { int y=10; if(y++>9 && y++!=10 && y++>11) cout<<y<<endl; else cout<<y<< endl; } 16
  • 17. 17