SlideShare a Scribd company logo
Procedure Oriented programming Object Oriented programming  Basic Concept of Object Oriented programming A simple C++ Program  Structure of C++ Program
 Procedure Oriented programming
 Object Oriented programming
 Basic Concept of Object Oriented programming
 A simple C++ Program
 Structure of C++ Program
 Application of C++
C was developed by Dennis Ritchie between the year 1969
and 1973 at AT&T Bell Labs.
C++ was developed by Bjarne Stroustrup in 1979.
For the development of code, C supports procedural
programming.
C++ is known as hybrid language because C++ supports
both procedural and object oriented programming
paradigms.
C is a function driven language because C is a procedural
programming language.
C++ is an object driven language because it is an object
oriented programming.
Standard IO header is stdio.h. Standard IO header is iostream.h.
scanf() and printf() functions are used for input/output in C.
cin and cout are used for input/output in C++
There are 32 keywords in the C There are 97 keywords in the C++
File extension is “.c” File extension is “.cpp” or “.c++” or “.cc” or “.cxx”
C structures don’t have access modifiers. C ++ structures have access modifiers.
Direct support for exception handling is not supported by C. Exception handling is supported by C++.
Object Oriented programming
C++ is a cross-platform language that can be used to create
high-performance applications.
C++ was developed as an extension of C, and both languages
have almost the same syntax.
The main difference between C and C++ is that C++ support
classes and objects, while C does not.
C++ was developed by Bjarne Stroustrup, as an extension to
the C language.
C++ gives programmers a high level of control over system
resources and memory.
The language was updated 4 major times in 2011, 2014, 2017,
and 2020 to C++11, C++14, C++17, C++20.
Why Use C++
 C++ is one of the world's most popular programming languages.
 C++ can be found in today's operating systems, Graphical User
Interfaces, and embedded systems.
 C++ is an object-oriented programming language which gives a
clear structure to programs and allows code to be reused, lowering
development costs.
 C++ is portable and can be used to develop applications that can be
adapted to multiple platforms.
 C++ is fun and easy to learn!
 As C++ is close to C, C# and Java, it makes it easy for programmers
to switch to C++ or vice versa.
C++ Variables
Variables are containers for storing data values.
In C++, there are different types of variables (defined with different keywords),
int -
stores integers (whole numbers), without decimals, such as 123 or -123
double -
stores floating point numbers, with decimals, such as 19.99 or -19.99
char -
stores single characters, such as 'a' or 'B'. Char values are surrounded by single quotes
string -
stores text, such as "Hello World". String values are surrounded by double quotes
bool -
stores values with two states: true or false
Declaring (Creating) Variables
Declare Many Variables
C++ Identifiers
 All C++ variables must be identified with unique names.
 These unique names are called identifiers.
 Identifiers can be short names (like x and y) or more descriptive
names (age, sum, totalVolume).
 The general rules for naming variables are:
 Names can contain letters, digits and underscores
 Names must begin with a letter or an underscore (_)
 Names are case-sensitive (myVar and myvar are different variables)
 Names cannot contain whitespaces or special characters like !, #, %,
etc.
 Reserved words (like C++ keywords, such as int) cannot be used as
names
Example
A simple C++ Program
#include<iostream.h>
includes the standard input output library functions.
It provides cin and cout methods for reading from
input and writing to output respectively.
#include <conio.h>
includes the console input output library functions.
The getch() function is defined in conio.h file.
void main()
The main() function is the entry point of every
program in C++ language. The void keyword
specifies that it returns no value.
cout << "Welcome to C++ Programming."
is used to print the data "Welcome to C++ Program
ming." on the console.
getch()
The getch() function asks for a single character. Until
you press any key, it blocks the screen.
Constants
continue
Constants
When you declare a constant variable, it must be assigned with a value:
const int minutesPerHour = 60;
C++ User Input
 cout is used to output (print) values. Now we will
use cin to get user input.
cin is a predefined variable that reads data from
the keyboard with the extraction operator (>>).
cout is pronounced "see-out". Used for output,
and uses the insertion operator (<<)
cin is pronounced "see-in". Used for input, and
uses the extraction operator (>>)
Basic Concept of Object Oriented programming
CLASS AND OBJECT
FRUIT
APPLE
OBJECT
GRAPES
OBJECT
MANGO
OBJECT
BANANA
OBJECT
Class
(Fruit)
Classes and objects are the two main
aspects of object-oriented
programming.
A class is a template for objects, and
an object is an instance of a class.
When the individual objects are
created, they inherit all the variables
and functions from the class.
• Encapsulation in C++ is defined
as the wrapping up of data
and information in a single
unit.
• In Object Oriented
Programming, Encapsulation is
defined as binding together
the data and the functions
that manipulate them.
• Two Important property of
Encapsulation
Data Protection
Information Hiding
Data Abstraction
 Data Abstraction is a process of providing only the essential details to the
outside world and hiding the internal details, i.e., representing only the
essential details in the program.
 Let's take a real life example of AC, which can be turned ON or OFF, change
the temperature, change the mode, and other external components such as fan,
swing. But, we don't know the internal details of the AC, i.e., how it works
internally. Thus, we can say that AC seperates the implementation details from
the external interface.
Polymorphism
• The word “polymorphism” means
having many forms
Polymorphism is considered one
of the important features of
Object-Oriented Programming..
• A real-life example of
polymorphism is a person who at
the same time can have different
characteristics. A man at the same
time is a father, a husband, and an
employee. So the same person
exhibits different behavior in
different situations. This is called
polymorphism.
INHERITANCE
Inheritance is one of the key features of Object-oriented programming in C++.
It allows us to create a new class (derived class) from an existing class
(base class).
The derived class inherits the features from the base class and can have
additional features of its own.
 Inheritance is an is-a relationship. We use inheritance only if an is-a
relationship is present between the two classes.
 Here are some examples:
 A car is a vehicle.
 Orange is a fruit.
 A surgeon is a doctor.
 A dog is an animal.
The derived class inherits the features from the base class
Derived Classes
Types Of Inheritance
Application of C++
 Google: C++ is used for lots of google magic like Big table, Google file system,
Google Chromium browser, and MapReduce large cluster data processing are all
written in C++.
 Mozilla uses a subset of C++. C++ 14 is required to build Mozilla 59, Mozilla
Firefox, and Thunderbird email chat client are both written using C++.
 Microsoft: Lots of windows apps that you regularly use are written in C++, It
features tools for developing and debugging C++ code, especially code written for
the DirectX, Windows API, and .NET.
 Rockstar Games: Almost all major game companies use C++ due to its right speed
on bare metal. Many major game engines are fully written in C++ and leverage its
speed and OOPs capabilities.
 MongoDB: MongoDB is an open-source database, widely used as the back-end
store for web applications, as well as in large enterprises like Viacom,
biotechnology giants, and Disney.
 Games and Animations: C++ is used for developing games. It simplifies the
complexity of 3-Dimensional games and helps in optimizing the resources.

More Related Content

PPTX
Object oriented programming. (1).pptx
PPT
The smartpath information systems c plus plus
PPTX
C++ with student management system project
PPTX
OOP CHAPTER object oreinted programming using c++
PDF
CS305PC_C++_UNIT 1 notes jntuh third semester
PPTX
C++ overview
PPTX
Lecture 1.pptx
PDF
M.c.a (sem iii) paper - i - object oriented programming
Object oriented programming. (1).pptx
The smartpath information systems c plus plus
C++ with student management system project
OOP CHAPTER object oreinted programming using c++
CS305PC_C++_UNIT 1 notes jntuh third semester
C++ overview
Lecture 1.pptx
M.c.a (sem iii) paper - i - object oriented programming

Similar to Procedure Oriented programming Object Oriented programming Basic Concept of Object Oriented programming A simple C++ Program Structure of C++ Program (20)

PDF
C++
PPTX
Object Oriented Programming Using C++.pptx
PDF
C++ Programming with examples for B.Tech
PPTX
Object oriented programming 7 first steps in oop using c++
PPTX
UNIT - 1- Ood ddnwkjfnewcsdkjnjkfnskfn.pptx
PPTX
Interoduction to c++
PPTX
C++ Langauage Training in Ambala ! BATRA COMPUTER CENTRE
PPTX
object oriented programming language in c++
PPT
Oops and c fundamentals
PPTX
C++ language basic
PDF
C++ Version 2
PPT
lecture02-cpp.ppt
PPTX
Introduction to C++ Programming
PPTX
Summer Training Project On C++
PPT
c++ ppt.ppt
PPTX
c++session 1.pptx
PPTX
C++ & Data Structure - Unit - first.pptx
PPT
lecture5-cpp.pptintroduccionaC++basicoye
C++
Object Oriented Programming Using C++.pptx
C++ Programming with examples for B.Tech
Object oriented programming 7 first steps in oop using c++
UNIT - 1- Ood ddnwkjfnewcsdkjnjkfnskfn.pptx
Interoduction to c++
C++ Langauage Training in Ambala ! BATRA COMPUTER CENTRE
object oriented programming language in c++
Oops and c fundamentals
C++ language basic
C++ Version 2
lecture02-cpp.ppt
Introduction to C++ Programming
Summer Training Project On C++
c++ ppt.ppt
c++session 1.pptx
C++ & Data Structure - Unit - first.pptx
lecture5-cpp.pptintroduccionaC++basicoye
Ad

Recently uploaded (20)

PDF
احياء السادس العلمي - الفصل الثالث (التكاثر) منهج متميزين/كلية بغداد/موهوبين
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PDF
advance database management system book.pdf
PPTX
Introduction to Building Materials
PDF
Practical Manual AGRO-233 Principles and Practices of Natural Farming
PDF
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PPTX
A powerpoint presentation on the Revised K-10 Science Shaping Paper
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
LDMMIA Reiki Yoga Finals Review Spring Summer
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
Classroom Observation Tools for Teachers
PDF
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
PPTX
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
PDF
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
PDF
LNK 2025 (2).pdf MWEHEHEHEHEHEHEHEHEHEHE
PPTX
CHAPTER IV. MAN AND BIOSPHERE AND ITS TOTALITY.pptx
PDF
Trump Administration's workforce development strategy
PDF
SOIL: Factor, Horizon, Process, Classification, Degradation, Conservation
احياء السادس العلمي - الفصل الثالث (التكاثر) منهج متميزين/كلية بغداد/موهوبين
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
advance database management system book.pdf
Introduction to Building Materials
Practical Manual AGRO-233 Principles and Practices of Natural Farming
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
A powerpoint presentation on the Revised K-10 Science Shaping Paper
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Final Presentation General Medicine 03-08-2024.pptx
LDMMIA Reiki Yoga Finals Review Spring Summer
Supply Chain Operations Speaking Notes -ICLT Program
Classroom Observation Tools for Teachers
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
LNK 2025 (2).pdf MWEHEHEHEHEHEHEHEHEHEHE
CHAPTER IV. MAN AND BIOSPHERE AND ITS TOTALITY.pptx
Trump Administration's workforce development strategy
SOIL: Factor, Horizon, Process, Classification, Degradation, Conservation
Ad

Procedure Oriented programming Object Oriented programming Basic Concept of Object Oriented programming A simple C++ Program Structure of C++ Program

  • 2.  Procedure Oriented programming  Object Oriented programming  Basic Concept of Object Oriented programming  A simple C++ Program  Structure of C++ Program  Application of C++
  • 3. C was developed by Dennis Ritchie between the year 1969 and 1973 at AT&T Bell Labs. C++ was developed by Bjarne Stroustrup in 1979. For the development of code, C supports procedural programming. C++ is known as hybrid language because C++ supports both procedural and object oriented programming paradigms. C is a function driven language because C is a procedural programming language. C++ is an object driven language because it is an object oriented programming. Standard IO header is stdio.h. Standard IO header is iostream.h. scanf() and printf() functions are used for input/output in C. cin and cout are used for input/output in C++ There are 32 keywords in the C There are 97 keywords in the C++ File extension is “.c” File extension is “.cpp” or “.c++” or “.cc” or “.cxx” C structures don’t have access modifiers. C ++ structures have access modifiers. Direct support for exception handling is not supported by C. Exception handling is supported by C++.
  • 4. Object Oriented programming C++ is a cross-platform language that can be used to create high-performance applications. C++ was developed as an extension of C, and both languages have almost the same syntax. The main difference between C and C++ is that C++ support classes and objects, while C does not. C++ was developed by Bjarne Stroustrup, as an extension to the C language. C++ gives programmers a high level of control over system resources and memory. The language was updated 4 major times in 2011, 2014, 2017, and 2020 to C++11, C++14, C++17, C++20.
  • 5. Why Use C++  C++ is one of the world's most popular programming languages.  C++ can be found in today's operating systems, Graphical User Interfaces, and embedded systems.  C++ is an object-oriented programming language which gives a clear structure to programs and allows code to be reused, lowering development costs.  C++ is portable and can be used to develop applications that can be adapted to multiple platforms.  C++ is fun and easy to learn!  As C++ is close to C, C# and Java, it makes it easy for programmers to switch to C++ or vice versa.
  • 6. C++ Variables Variables are containers for storing data values. In C++, there are different types of variables (defined with different keywords), int - stores integers (whole numbers), without decimals, such as 123 or -123 double - stores floating point numbers, with decimals, such as 19.99 or -19.99 char - stores single characters, such as 'a' or 'B'. Char values are surrounded by single quotes string - stores text, such as "Hello World". String values are surrounded by double quotes bool - stores values with two states: true or false
  • 9. C++ Identifiers  All C++ variables must be identified with unique names.  These unique names are called identifiers.  Identifiers can be short names (like x and y) or more descriptive names (age, sum, totalVolume).  The general rules for naming variables are:  Names can contain letters, digits and underscores  Names must begin with a letter or an underscore (_)  Names are case-sensitive (myVar and myvar are different variables)  Names cannot contain whitespaces or special characters like !, #, %, etc.  Reserved words (like C++ keywords, such as int) cannot be used as names
  • 11. A simple C++ Program #include<iostream.h> includes the standard input output library functions. It provides cin and cout methods for reading from input and writing to output respectively. #include <conio.h> includes the console input output library functions. The getch() function is defined in conio.h file. void main() The main() function is the entry point of every program in C++ language. The void keyword specifies that it returns no value. cout << "Welcome to C++ Programming." is used to print the data "Welcome to C++ Program ming." on the console. getch() The getch() function asks for a single character. Until you press any key, it blocks the screen.
  • 14. Constants When you declare a constant variable, it must be assigned with a value: const int minutesPerHour = 60;
  • 15. C++ User Input  cout is used to output (print) values. Now we will use cin to get user input. cin is a predefined variable that reads data from the keyboard with the extraction operator (>>). cout is pronounced "see-out". Used for output, and uses the insertion operator (<<) cin is pronounced "see-in". Used for input, and uses the extraction operator (>>)
  • 16. Basic Concept of Object Oriented programming
  • 17. CLASS AND OBJECT FRUIT APPLE OBJECT GRAPES OBJECT MANGO OBJECT BANANA OBJECT Class (Fruit) Classes and objects are the two main aspects of object-oriented programming. A class is a template for objects, and an object is an instance of a class. When the individual objects are created, they inherit all the variables and functions from the class.
  • 18. • Encapsulation in C++ is defined as the wrapping up of data and information in a single unit. • In Object Oriented Programming, Encapsulation is defined as binding together the data and the functions that manipulate them. • Two Important property of Encapsulation Data Protection Information Hiding
  • 19. Data Abstraction  Data Abstraction is a process of providing only the essential details to the outside world and hiding the internal details, i.e., representing only the essential details in the program.  Let's take a real life example of AC, which can be turned ON or OFF, change the temperature, change the mode, and other external components such as fan, swing. But, we don't know the internal details of the AC, i.e., how it works internally. Thus, we can say that AC seperates the implementation details from the external interface.
  • 20. Polymorphism • The word “polymorphism” means having many forms Polymorphism is considered one of the important features of Object-Oriented Programming.. • A real-life example of polymorphism is a person who at the same time can have different characteristics. A man at the same time is a father, a husband, and an employee. So the same person exhibits different behavior in different situations. This is called polymorphism.
  • 21. INHERITANCE Inheritance is one of the key features of Object-oriented programming in C++. It allows us to create a new class (derived class) from an existing class (base class). The derived class inherits the features from the base class and can have additional features of its own.  Inheritance is an is-a relationship. We use inheritance only if an is-a relationship is present between the two classes.  Here are some examples:  A car is a vehicle.  Orange is a fruit.  A surgeon is a doctor.  A dog is an animal.
  • 22. The derived class inherits the features from the base class
  • 25. Application of C++  Google: C++ is used for lots of google magic like Big table, Google file system, Google Chromium browser, and MapReduce large cluster data processing are all written in C++.  Mozilla uses a subset of C++. C++ 14 is required to build Mozilla 59, Mozilla Firefox, and Thunderbird email chat client are both written using C++.  Microsoft: Lots of windows apps that you regularly use are written in C++, It features tools for developing and debugging C++ code, especially code written for the DirectX, Windows API, and .NET.  Rockstar Games: Almost all major game companies use C++ due to its right speed on bare metal. Many major game engines are fully written in C++ and leverage its speed and OOPs capabilities.  MongoDB: MongoDB is an open-source database, widely used as the back-end store for web applications, as well as in large enterprises like Viacom, biotechnology giants, and Disney.  Games and Animations: C++ is used for developing games. It simplifies the complexity of 3-Dimensional games and helps in optimizing the resources.