SlideShare a Scribd company logo
object oriented programming language in c++
C++ Evolution
 The prime purpose of C++ programming was to add object
orientation to the C programming language, which is in
itself one of the most powerful programming languages.
 C++ is regarded as a middle-level language, as it
comprises a combination of both high-level and low-level
language features.
 C++ was developed by Bjarne Stroustrup starting in 1979 at
Bell Labs in Murray Hill, New Jersey, as an enhancement to
the C language and originally named C with Classes but
later it was renamed C++ in 1983.
 C++ is a superset of C, and that virtually any legal C
program is a legal C++ program.
Procedure-oriented Programming
Some Characteristics exhibited by procedure-oriented
programming are:
• Emphasis is on doing things (algorithms).
• Large programs are divided into smaller programs known
as functions.
• Most of the functions share global data.
• Data move openly around the system from function to
function.
• Functions transform data from one form to another.
• Employs top-down approach in program design.
Object Oriented Programming
Some of the features of object oriented programming are:
 Emphasis is on data rather than procedure
 Element in the program development and does not allow it
to flow freely around the system
 OOP allows decomposition of a problem into a number of
entities called objects and then builds data and function
around these
 Programs are divided into what are known as objects
 Functions that operate on the data of an object are ties
together in the data structure.
 Data is hidden and cannot be accessed by external
function.
 Objects may communicate with each other through
function.
 Follows bottom-up approach in program design.
Basic Concepts of Object Oriented
Programming
These include:
 Objects
 Classes
 Data abstraction and encapsulation
 Inheritance
 Polymorphism
Objects
 An object is a software bundle of related state and
behavior.
 Software objects are often used to model the real-
world objects that you find in everyday life.
 That is both data and function that operate on data are
bundled as a unit called as object.
 Objects are the basic run time entities in an object-
oriented system. They may represent a person, a place,
a bank account, a table of data or any item that the
program has to handle. They may also represent user-
defined data such as time and lists.
Organization of Data and Function
object oriented programming language in c++
Class
 A class is a blueprint or prototype from which objects
are created.
 Models the state and behavior of a real-world object.
 This doesn't actually define any data, but it does define
what the class name means, that is, what an object of
the class will consist of and what operations can be
performed on such an object.
 In fact, objects are variables of the type class.
 For examples, Mango, Apple and orange members of
class fruit.
Abstraction
 Data abstraction refers to, providing only essential
information to the outside word and hiding their
background details, i.e., to represent the needed
information in program without presenting the
details.
 Classes use the concept of abstraction and are defined
as a list of abstract attributes such as size, wait, and
cost, and function operate on these attributes.
 The attributes are some time called data members
because they hold information. The functions that
operate on these data are sometimes called methods or
member function.
Encapsulation
 Encapsulation is placing the data and the functions
that work on that data in the same place. While
working with procedural languages, it is not always
clear which functions work on which variables but
object-oriented programming provides you framework
to place the data and the relevant functions together in
the same object.
Inheritance
 One of the most useful aspects of object-oriented
programming is code reusability. As the name suggests
Inheritance is the process of forming a new class from
an existing class that is from the existing class called as
base class, new class is formed called as derived class.
 This is a very important concept of object-oriented
programming since this feature helps to reduce the
code size
Polymorphism
 Polymorphism, a Greek term, means the ability to take
more than on form.
 The ability to use an operator or function in different
ways in other words giving different meaning to the
operators or functions is called polymorphism. Poly
refers to many. That is a single function or an operator
functioning in many ways different upon the usage is
called polymorphism.
 The process of making an operator to exhibit different
behaviors in different instances is known as operator
overloading
 Single function name can be used to handle different
number and different types of argument. This is
something similar to a particular word having several
different meanings depending upon the context. Using
a single function name to perform different type of
task is known as function overloading.
object oriented programming language in c++
Benefits of OOP
 Through inheritance, we can eliminate redundant
code extend the use of existing Classes
 We can build programs from the standard working
modules that communicate with one another, rather
than having to start writing the code from scratch.
This leads to saving of development time and higher
productivity
 The principle of data hiding helps the programmer to
build secure program that can not be invaded by code
in other parts of a programs
 It is easy to partition the work in a project based on
objects.
 Object-oriented system can be easily upgraded from
small to large system.
 Software complexity can be easily managed.
Application of OOP
 Real-time system
 Simulation and modeling
 Object-oriented data bases
 AI and expert systems
 Neural networks and parallel programming
 Decision support and office automation systems
 CIM/CAM/CAD systems
#include<iostream>
using namespace std;
int main()
{
cout << “ C++ is better than C.n”; // C++ statement
return 0;
}
A Simple Program
Printing a Line of Text on the Screen
#include<iostream>
 The #include directive instructs the compiler to
include the contents of the file enclosed within
angular brackets into the source file.
 Contains declarations for the identifier cout and
operator <<
 The header file iostream should be included at the
beginning of all programs that use input/output
statements.
using namespace std;
 Namespace is a new concept introduced by the ANSI
C++ standards committee.
 This defines a scope for the identifiers that are used in
a program.
 Namespace: a naming context to distinguish between
different items with the same name
 C++ namespace: contains classes, variables, constants,
functions, etc.
 For using the identifier defined in the namespace
scope we must include the using directive
 Here, std is the namespace where ANSI C++ standard
class libraries are defined.
cout << “ C++ is better than C.n”;
 Causes the string in quotation marks to be displayed
on the screen.
 This statement introduces two new C++ features,
1. cout
2. <<
 The identifier cout is a predefined object that
represents the standard output stream in C++.
 The operator << is called the insertion or put to
operator.
Comments
// C++ statement
 C++ introduces a new comment symbol // (double
slash).
 The double slash comment is basically a single line
comment. Multiline comments can be written as
follows:
// This is an example of
// C++ program to illustrate
// some of its features
 The C comment symbols /*,*/ are still valid and are
more suitable for multiline comments. The following
comment is allowed:
/* This is an example of
C++ program to illustrate
some of its features
*/
AVERAGE OF TWO NUMBERS
#include<iostream> // include header file
using namespace std;
int main()
{
float number1, number2, sum, average;
cout << “Enter two numbers:”;
cin >> number1; // Read Numbers
cin >> number2; // from keyboard
sum = number1 + number2;
average = sum/2;
cout << ”Sum = “ << sum << “n”;
cout << “Average = “ << average << “n”;
return 0;
} //end of example
The output would be:
Enter two numbers: 6.5 7.5
Sum = 14
Average = 7
cin >> number1
 Is an input statement and causes the program to wait
for the user to type in a number. The number keyed in
is placed in the variable number1.
 The operator >> is known as extraction or get from
operator.
cout << ”Sum = “ << sum << “n”;
Cascading of I/O Operators
 The statement First sends the string “Sum = “ to cout and
then sends the value of sum. Finally, it sends the newline
character so that the next output will be in the new line.
Using the cascading technique, the last two statements can
be combined as follows:
1. Cout << “Sum = “ << sum << “n”
<< “Average = “ << average << “n”;
2. Cout << “Sum = “ << sum << “,”
<< “Average = “ << average << “n”;
 We can also cascade input operator >> as shown below:
Cin >> number1 >> number2;
Example with Class
 One of the major features of C++ is classes. They provide a method of binding
together data and functions which operate on them.
#include<iostream> // include header file
using namespace std;
class person
{
char name[30];
Int age;
public:
void getdata(void);
void display(void);
};
void person :: getdata(void)
{
cout << “Enter name: “;
cin >> name;
cout << “Enter age: “;
cin >> age;
Void person : : display(void)
{
cout << “nNameame: “ << name;
cout << “nAge: “ << age;
}
Int main()
{
person p;
p.getdata();
p.display();
Return 0;
} //end of example
The output of program is:
Enter Name: Ravinder
Enter age:30
Name:Ravinder
Age: 30

More Related Content

Similar to object oriented programming language in c++ (20)

Unit 5.ppt
Unit 5.pptUnit 5.ppt
Unit 5.ppt
JITTAYASHWANTHREDDY
 
Mca 2 sem u-1 iintroduction
Mca 2 sem u-1 iintroductionMca 2 sem u-1 iintroduction
Mca 2 sem u-1 iintroduction
Rai University
 
73d32 session1 c++
73d32 session1 c++73d32 session1 c++
73d32 session1 c++
Mukund Trivedi
 
Object oriented programming 7 first steps in oop using c++
Object oriented programming 7 first steps in oop using  c++Object oriented programming 7 first steps in oop using  c++
Object oriented programming 7 first steps in oop using c++
Vaibhav Khanna
 
Programming in c++
Programming in c++Programming in c++
Programming in c++
MalarMohana
 
Programming in c++
Programming in c++Programming in c++
Programming in c++
sujathavvv
 
Oops
OopsOops
Oops
PRABHAHARAN429
 
Introduction to C++ Programming
Introduction to C++ ProgrammingIntroduction to C++ Programming
Introduction to C++ Programming
Preeti Kashyap
 
Object oriented programming. (1).pptx
Object oriented programming.      (1).pptxObject oriented programming.      (1).pptx
Object oriented programming. (1).pptx
baadshahyash
 
OOPS_Unit_1
OOPS_Unit_1OOPS_Unit_1
OOPS_Unit_1
Shipra Swati
 
@vtucode.in-module-1-c++-2022-scheme.pdf
@vtucode.in-module-1-c++-2022-scheme.pdf@vtucode.in-module-1-c++-2022-scheme.pdf
@vtucode.in-module-1-c++-2022-scheme.pdf
TheertheshTheertha1
 
C++ Programming with examples for B.Tech
C++ Programming with examples for B.TechC++ Programming with examples for B.Tech
C++ Programming with examples for B.Tech
ashutoshgupta1102
 
The smartpath information systems c plus plus
The smartpath information systems  c plus plusThe smartpath information systems  c plus plus
The smartpath information systems c plus plus
The Smartpath Information Systems,Bhilai,Durg,Chhattisgarh.
 
the education purpose of software C++.ppt
the education purpose of software C++.pptthe education purpose of software C++.ppt
the education purpose of software C++.ppt
FarookMohamed12
 
CPP_,module2_1.pptx
CPP_,module2_1.pptxCPP_,module2_1.pptx
CPP_,module2_1.pptx
AbhilashTom4
 
C++ basic intro on c++ programming language ppt
C++ basic intro on c++ programming language pptC++ basic intro on c++ programming language ppt
C++ basic intro on c++ programming language ppt
PavithraD65
 
OOC MODULE1.pptx
OOC MODULE1.pptxOOC MODULE1.pptx
OOC MODULE1.pptx
1HK19CS090MOHAMMEDSA
 
Object oriented concepts
Object oriented conceptsObject oriented concepts
Object oriented concepts
Pranali Chaudhari
 
C++ first s lide
C++ first s lideC++ first s lide
C++ first s lide
Sudhriti Gupta
 
Object Oriented Technologies
Object Oriented TechnologiesObject Oriented Technologies
Object Oriented Technologies
Umesh Nikam
 
Mca 2 sem u-1 iintroduction
Mca 2 sem u-1 iintroductionMca 2 sem u-1 iintroduction
Mca 2 sem u-1 iintroduction
Rai University
 
Object oriented programming 7 first steps in oop using c++
Object oriented programming 7 first steps in oop using  c++Object oriented programming 7 first steps in oop using  c++
Object oriented programming 7 first steps in oop using c++
Vaibhav Khanna
 
Programming in c++
Programming in c++Programming in c++
Programming in c++
MalarMohana
 
Programming in c++
Programming in c++Programming in c++
Programming in c++
sujathavvv
 
Introduction to C++ Programming
Introduction to C++ ProgrammingIntroduction to C++ Programming
Introduction to C++ Programming
Preeti Kashyap
 
Object oriented programming. (1).pptx
Object oriented programming.      (1).pptxObject oriented programming.      (1).pptx
Object oriented programming. (1).pptx
baadshahyash
 
@vtucode.in-module-1-c++-2022-scheme.pdf
@vtucode.in-module-1-c++-2022-scheme.pdf@vtucode.in-module-1-c++-2022-scheme.pdf
@vtucode.in-module-1-c++-2022-scheme.pdf
TheertheshTheertha1
 
C++ Programming with examples for B.Tech
C++ Programming with examples for B.TechC++ Programming with examples for B.Tech
C++ Programming with examples for B.Tech
ashutoshgupta1102
 
the education purpose of software C++.ppt
the education purpose of software C++.pptthe education purpose of software C++.ppt
the education purpose of software C++.ppt
FarookMohamed12
 
CPP_,module2_1.pptx
CPP_,module2_1.pptxCPP_,module2_1.pptx
CPP_,module2_1.pptx
AbhilashTom4
 
C++ basic intro on c++ programming language ppt
C++ basic intro on c++ programming language pptC++ basic intro on c++ programming language ppt
C++ basic intro on c++ programming language ppt
PavithraD65
 
Object Oriented Technologies
Object Oriented TechnologiesObject Oriented Technologies
Object Oriented Technologies
Umesh Nikam
 

Recently uploaded (20)

apidays New York 2025 - Building Green Software by Marissa Jasso & Katya Drey...
apidays New York 2025 - Building Green Software by Marissa Jasso & Katya Drey...apidays New York 2025 - Building Green Software by Marissa Jasso & Katya Drey...
apidays New York 2025 - Building Green Software by Marissa Jasso & Katya Drey...
apidays
 
BODMAS-Rule-&-Unit-Digit-Concept-pdf.pdf
BODMAS-Rule-&-Unit-Digit-Concept-pdf.pdfBODMAS-Rule-&-Unit-Digit-Concept-pdf.pdf
BODMAS-Rule-&-Unit-Digit-Concept-pdf.pdf
SiddharthSean
 
apidays New York 2025 - Fast, Repeatable, Secure: Pick 3 with FINOS CCC by Le...
apidays New York 2025 - Fast, Repeatable, Secure: Pick 3 with FINOS CCC by Le...apidays New York 2025 - Fast, Repeatable, Secure: Pick 3 with FINOS CCC by Le...
apidays New York 2025 - Fast, Repeatable, Secure: Pick 3 with FINOS CCC by Le...
apidays
 
apidays Singapore 2025 - 4 Identity Essentials for Scaling SaaS in Large Orgs...
apidays Singapore 2025 - 4 Identity Essentials for Scaling SaaS in Large Orgs...apidays Singapore 2025 - 4 Identity Essentials for Scaling SaaS in Large Orgs...
apidays Singapore 2025 - 4 Identity Essentials for Scaling SaaS in Large Orgs...
apidays
 
Advanced_English_Pronunciation_in_Use.pdf
Advanced_English_Pronunciation_in_Use.pdfAdvanced_English_Pronunciation_in_Use.pdf
Advanced_English_Pronunciation_in_Use.pdf
leogoemmanguyenthao
 
apidays New York 2025 - Building Scalable AI Systems by Sai Prasad Veluru (Ap...
apidays New York 2025 - Building Scalable AI Systems by Sai Prasad Veluru (Ap...apidays New York 2025 - Building Scalable AI Systems by Sai Prasad Veluru (Ap...
apidays New York 2025 - Building Scalable AI Systems by Sai Prasad Veluru (Ap...
apidays
 
THE FRIEDMAN TEST ( Biostatics B. Pharm)
THE FRIEDMAN TEST ( Biostatics B. Pharm)THE FRIEDMAN TEST ( Biostatics B. Pharm)
THE FRIEDMAN TEST ( Biostatics B. Pharm)
JishuHaldar
 
BE PROGRAMjwjwjwjsjsjsjsME TEMPLATE.pptx
BE PROGRAMjwjwjwjsjsjsjsME TEMPLATE.pptxBE PROGRAMjwjwjwjsjsjsjsME TEMPLATE.pptx
BE PROGRAMjwjwjwjsjsjsjsME TEMPLATE.pptx
AaronBaluyut
 
apidays New York 2025 - Unifying OpenAPI & AsyncAPI by Naresh Jain & Hari Kri...
apidays New York 2025 - Unifying OpenAPI & AsyncAPI by Naresh Jain & Hari Kri...apidays New York 2025 - Unifying OpenAPI & AsyncAPI by Naresh Jain & Hari Kri...
apidays New York 2025 - Unifying OpenAPI & AsyncAPI by Naresh Jain & Hari Kri...
apidays
 
METHODS OF DATA COLLECTION (Research methodology)
METHODS OF DATA COLLECTION (Research methodology)METHODS OF DATA COLLECTION (Research methodology)
METHODS OF DATA COLLECTION (Research methodology)
anwesha248
 
apidays New York 2025 - Two tales of API Change Management by Eric Koleda (Coda)
apidays New York 2025 - Two tales of API Change Management by Eric Koleda (Coda)apidays New York 2025 - Two tales of API Change Management by Eric Koleda (Coda)
apidays New York 2025 - Two tales of API Change Management by Eric Koleda (Coda)
apidays
 
2.5-DESPATCH-ORDINARY MAILS.pptxlminub7b7t6f7h7t6f6g7g6fg
2.5-DESPATCH-ORDINARY MAILS.pptxlminub7b7t6f7h7t6f6g7g6fg2.5-DESPATCH-ORDINARY MAILS.pptxlminub7b7t6f7h7t6f6g7g6fg
2.5-DESPATCH-ORDINARY MAILS.pptxlminub7b7t6f7h7t6f6g7g6fg
mk1227103
 
LONGSEM2024-25_CSE3015_ETH_AP2024256000125_Reference-Material-I.pptx
LONGSEM2024-25_CSE3015_ETH_AP2024256000125_Reference-Material-I.pptxLONGSEM2024-25_CSE3015_ETH_AP2024256000125_Reference-Material-I.pptx
LONGSEM2024-25_CSE3015_ETH_AP2024256000125_Reference-Material-I.pptx
vemuripraveena2622
 
apidays New York 2025 - Beyond Webhooks: The Future of Scalable API Event Del...
apidays New York 2025 - Beyond Webhooks: The Future of Scalable API Event Del...apidays New York 2025 - Beyond Webhooks: The Future of Scalable API Event Del...
apidays New York 2025 - Beyond Webhooks: The Future of Scalable API Event Del...
apidays
 
What is FinOps as a Service and why is it Trending?
What is FinOps as a Service and why is it Trending?What is FinOps as a Service and why is it Trending?
What is FinOps as a Service and why is it Trending?
Amnic
 
apidays New York 2025 - Computers are still dumb by Ben Morss (DeepL)
apidays New York 2025 - Computers are still dumb by Ben Morss (DeepL)apidays New York 2025 - Computers are still dumb by Ben Morss (DeepL)
apidays New York 2025 - Computers are still dumb by Ben Morss (DeepL)
apidays
 
apidays New York 2025 - Using GraphQL SDL files as executable API Contracts b...
apidays New York 2025 - Using GraphQL SDL files as executable API Contracts b...apidays New York 2025 - Using GraphQL SDL files as executable API Contracts b...
apidays New York 2025 - Using GraphQL SDL files as executable API Contracts b...
apidays
 
MICROSOFT POWERPOINT AND USES(BEST)..pdf
MICROSOFT POWERPOINT AND USES(BEST)..pdfMICROSOFT POWERPOINT AND USES(BEST)..pdf
MICROSOFT POWERPOINT AND USES(BEST)..pdf
bathyates
 
Report_Government Authorities_Index_ENG_FIN.pdf
Report_Government Authorities_Index_ENG_FIN.pdfReport_Government Authorities_Index_ENG_FIN.pdf
Report_Government Authorities_Index_ENG_FIN.pdf
OlhaTatokhina1
 
Philippine-Constitution-and-Law in hospitality
Philippine-Constitution-and-Law in hospitalityPhilippine-Constitution-and-Law in hospitality
Philippine-Constitution-and-Law in hospitality
kikomendoza006
 
apidays New York 2025 - Building Green Software by Marissa Jasso & Katya Drey...
apidays New York 2025 - Building Green Software by Marissa Jasso & Katya Drey...apidays New York 2025 - Building Green Software by Marissa Jasso & Katya Drey...
apidays New York 2025 - Building Green Software by Marissa Jasso & Katya Drey...
apidays
 
BODMAS-Rule-&-Unit-Digit-Concept-pdf.pdf
BODMAS-Rule-&-Unit-Digit-Concept-pdf.pdfBODMAS-Rule-&-Unit-Digit-Concept-pdf.pdf
BODMAS-Rule-&-Unit-Digit-Concept-pdf.pdf
SiddharthSean
 
apidays New York 2025 - Fast, Repeatable, Secure: Pick 3 with FINOS CCC by Le...
apidays New York 2025 - Fast, Repeatable, Secure: Pick 3 with FINOS CCC by Le...apidays New York 2025 - Fast, Repeatable, Secure: Pick 3 with FINOS CCC by Le...
apidays New York 2025 - Fast, Repeatable, Secure: Pick 3 with FINOS CCC by Le...
apidays
 
apidays Singapore 2025 - 4 Identity Essentials for Scaling SaaS in Large Orgs...
apidays Singapore 2025 - 4 Identity Essentials for Scaling SaaS in Large Orgs...apidays Singapore 2025 - 4 Identity Essentials for Scaling SaaS in Large Orgs...
apidays Singapore 2025 - 4 Identity Essentials for Scaling SaaS in Large Orgs...
apidays
 
Advanced_English_Pronunciation_in_Use.pdf
Advanced_English_Pronunciation_in_Use.pdfAdvanced_English_Pronunciation_in_Use.pdf
Advanced_English_Pronunciation_in_Use.pdf
leogoemmanguyenthao
 
apidays New York 2025 - Building Scalable AI Systems by Sai Prasad Veluru (Ap...
apidays New York 2025 - Building Scalable AI Systems by Sai Prasad Veluru (Ap...apidays New York 2025 - Building Scalable AI Systems by Sai Prasad Veluru (Ap...
apidays New York 2025 - Building Scalable AI Systems by Sai Prasad Veluru (Ap...
apidays
 
THE FRIEDMAN TEST ( Biostatics B. Pharm)
THE FRIEDMAN TEST ( Biostatics B. Pharm)THE FRIEDMAN TEST ( Biostatics B. Pharm)
THE FRIEDMAN TEST ( Biostatics B. Pharm)
JishuHaldar
 
BE PROGRAMjwjwjwjsjsjsjsME TEMPLATE.pptx
BE PROGRAMjwjwjwjsjsjsjsME TEMPLATE.pptxBE PROGRAMjwjwjwjsjsjsjsME TEMPLATE.pptx
BE PROGRAMjwjwjwjsjsjsjsME TEMPLATE.pptx
AaronBaluyut
 
apidays New York 2025 - Unifying OpenAPI & AsyncAPI by Naresh Jain & Hari Kri...
apidays New York 2025 - Unifying OpenAPI & AsyncAPI by Naresh Jain & Hari Kri...apidays New York 2025 - Unifying OpenAPI & AsyncAPI by Naresh Jain & Hari Kri...
apidays New York 2025 - Unifying OpenAPI & AsyncAPI by Naresh Jain & Hari Kri...
apidays
 
METHODS OF DATA COLLECTION (Research methodology)
METHODS OF DATA COLLECTION (Research methodology)METHODS OF DATA COLLECTION (Research methodology)
METHODS OF DATA COLLECTION (Research methodology)
anwesha248
 
apidays New York 2025 - Two tales of API Change Management by Eric Koleda (Coda)
apidays New York 2025 - Two tales of API Change Management by Eric Koleda (Coda)apidays New York 2025 - Two tales of API Change Management by Eric Koleda (Coda)
apidays New York 2025 - Two tales of API Change Management by Eric Koleda (Coda)
apidays
 
2.5-DESPATCH-ORDINARY MAILS.pptxlminub7b7t6f7h7t6f6g7g6fg
2.5-DESPATCH-ORDINARY MAILS.pptxlminub7b7t6f7h7t6f6g7g6fg2.5-DESPATCH-ORDINARY MAILS.pptxlminub7b7t6f7h7t6f6g7g6fg
2.5-DESPATCH-ORDINARY MAILS.pptxlminub7b7t6f7h7t6f6g7g6fg
mk1227103
 
LONGSEM2024-25_CSE3015_ETH_AP2024256000125_Reference-Material-I.pptx
LONGSEM2024-25_CSE3015_ETH_AP2024256000125_Reference-Material-I.pptxLONGSEM2024-25_CSE3015_ETH_AP2024256000125_Reference-Material-I.pptx
LONGSEM2024-25_CSE3015_ETH_AP2024256000125_Reference-Material-I.pptx
vemuripraveena2622
 
apidays New York 2025 - Beyond Webhooks: The Future of Scalable API Event Del...
apidays New York 2025 - Beyond Webhooks: The Future of Scalable API Event Del...apidays New York 2025 - Beyond Webhooks: The Future of Scalable API Event Del...
apidays New York 2025 - Beyond Webhooks: The Future of Scalable API Event Del...
apidays
 
What is FinOps as a Service and why is it Trending?
What is FinOps as a Service and why is it Trending?What is FinOps as a Service and why is it Trending?
What is FinOps as a Service and why is it Trending?
Amnic
 
apidays New York 2025 - Computers are still dumb by Ben Morss (DeepL)
apidays New York 2025 - Computers are still dumb by Ben Morss (DeepL)apidays New York 2025 - Computers are still dumb by Ben Morss (DeepL)
apidays New York 2025 - Computers are still dumb by Ben Morss (DeepL)
apidays
 
apidays New York 2025 - Using GraphQL SDL files as executable API Contracts b...
apidays New York 2025 - Using GraphQL SDL files as executable API Contracts b...apidays New York 2025 - Using GraphQL SDL files as executable API Contracts b...
apidays New York 2025 - Using GraphQL SDL files as executable API Contracts b...
apidays
 
MICROSOFT POWERPOINT AND USES(BEST)..pdf
MICROSOFT POWERPOINT AND USES(BEST)..pdfMICROSOFT POWERPOINT AND USES(BEST)..pdf
MICROSOFT POWERPOINT AND USES(BEST)..pdf
bathyates
 
Report_Government Authorities_Index_ENG_FIN.pdf
Report_Government Authorities_Index_ENG_FIN.pdfReport_Government Authorities_Index_ENG_FIN.pdf
Report_Government Authorities_Index_ENG_FIN.pdf
OlhaTatokhina1
 
Philippine-Constitution-and-Law in hospitality
Philippine-Constitution-and-Law in hospitalityPhilippine-Constitution-and-Law in hospitality
Philippine-Constitution-and-Law in hospitality
kikomendoza006
 
Ad

object oriented programming language in c++

  • 2. C++ Evolution  The prime purpose of C++ programming was to add object orientation to the C programming language, which is in itself one of the most powerful programming languages.  C++ is regarded as a middle-level language, as it comprises a combination of both high-level and low-level language features.  C++ was developed by Bjarne Stroustrup starting in 1979 at Bell Labs in Murray Hill, New Jersey, as an enhancement to the C language and originally named C with Classes but later it was renamed C++ in 1983.  C++ is a superset of C, and that virtually any legal C program is a legal C++ program.
  • 3. Procedure-oriented Programming Some Characteristics exhibited by procedure-oriented programming are: • Emphasis is on doing things (algorithms). • Large programs are divided into smaller programs known as functions. • Most of the functions share global data. • Data move openly around the system from function to function. • Functions transform data from one form to another. • Employs top-down approach in program design.
  • 4. Object Oriented Programming Some of the features of object oriented programming are:  Emphasis is on data rather than procedure  Element in the program development and does not allow it to flow freely around the system  OOP allows decomposition of a problem into a number of entities called objects and then builds data and function around these  Programs are divided into what are known as objects  Functions that operate on the data of an object are ties together in the data structure.  Data is hidden and cannot be accessed by external function.  Objects may communicate with each other through function.  Follows bottom-up approach in program design.
  • 5. Basic Concepts of Object Oriented Programming These include:  Objects  Classes  Data abstraction and encapsulation  Inheritance  Polymorphism
  • 6. Objects  An object is a software bundle of related state and behavior.  Software objects are often used to model the real- world objects that you find in everyday life.  That is both data and function that operate on data are bundled as a unit called as object.  Objects are the basic run time entities in an object- oriented system. They may represent a person, a place, a bank account, a table of data or any item that the program has to handle. They may also represent user- defined data such as time and lists.
  • 7. Organization of Data and Function
  • 9. Class  A class is a blueprint or prototype from which objects are created.  Models the state and behavior of a real-world object.  This doesn't actually define any data, but it does define what the class name means, that is, what an object of the class will consist of and what operations can be performed on such an object.  In fact, objects are variables of the type class.  For examples, Mango, Apple and orange members of class fruit.
  • 10. Abstraction  Data abstraction refers to, providing only essential information to the outside word and hiding their background details, i.e., to represent the needed information in program without presenting the details.  Classes use the concept of abstraction and are defined as a list of abstract attributes such as size, wait, and cost, and function operate on these attributes.  The attributes are some time called data members because they hold information. The functions that operate on these data are sometimes called methods or member function.
  • 11. Encapsulation  Encapsulation is placing the data and the functions that work on that data in the same place. While working with procedural languages, it is not always clear which functions work on which variables but object-oriented programming provides you framework to place the data and the relevant functions together in the same object.
  • 12. Inheritance  One of the most useful aspects of object-oriented programming is code reusability. As the name suggests Inheritance is the process of forming a new class from an existing class that is from the existing class called as base class, new class is formed called as derived class.  This is a very important concept of object-oriented programming since this feature helps to reduce the code size
  • 13. Polymorphism  Polymorphism, a Greek term, means the ability to take more than on form.  The ability to use an operator or function in different ways in other words giving different meaning to the operators or functions is called polymorphism. Poly refers to many. That is a single function or an operator functioning in many ways different upon the usage is called polymorphism.
  • 14.  The process of making an operator to exhibit different behaviors in different instances is known as operator overloading  Single function name can be used to handle different number and different types of argument. This is something similar to a particular word having several different meanings depending upon the context. Using a single function name to perform different type of task is known as function overloading.
  • 16. Benefits of OOP  Through inheritance, we can eliminate redundant code extend the use of existing Classes  We can build programs from the standard working modules that communicate with one another, rather than having to start writing the code from scratch. This leads to saving of development time and higher productivity  The principle of data hiding helps the programmer to build secure program that can not be invaded by code in other parts of a programs
  • 17.  It is easy to partition the work in a project based on objects.  Object-oriented system can be easily upgraded from small to large system.  Software complexity can be easily managed.
  • 18. Application of OOP  Real-time system  Simulation and modeling  Object-oriented data bases  AI and expert systems  Neural networks and parallel programming  Decision support and office automation systems  CIM/CAM/CAD systems
  • 19. #include<iostream> using namespace std; int main() { cout << “ C++ is better than C.n”; // C++ statement return 0; } A Simple Program Printing a Line of Text on the Screen
  • 20. #include<iostream>  The #include directive instructs the compiler to include the contents of the file enclosed within angular brackets into the source file.  Contains declarations for the identifier cout and operator <<  The header file iostream should be included at the beginning of all programs that use input/output statements.
  • 21. using namespace std;  Namespace is a new concept introduced by the ANSI C++ standards committee.  This defines a scope for the identifiers that are used in a program.  Namespace: a naming context to distinguish between different items with the same name  C++ namespace: contains classes, variables, constants, functions, etc.  For using the identifier defined in the namespace scope we must include the using directive  Here, std is the namespace where ANSI C++ standard class libraries are defined.
  • 22. cout << “ C++ is better than C.n”;  Causes the string in quotation marks to be displayed on the screen.  This statement introduces two new C++ features, 1. cout 2. <<  The identifier cout is a predefined object that represents the standard output stream in C++.  The operator << is called the insertion or put to operator.
  • 23. Comments // C++ statement  C++ introduces a new comment symbol // (double slash).  The double slash comment is basically a single line comment. Multiline comments can be written as follows: // This is an example of // C++ program to illustrate // some of its features
  • 24.  The C comment symbols /*,*/ are still valid and are more suitable for multiline comments. The following comment is allowed: /* This is an example of C++ program to illustrate some of its features */
  • 25. AVERAGE OF TWO NUMBERS #include<iostream> // include header file using namespace std; int main() { float number1, number2, sum, average; cout << “Enter two numbers:”; cin >> number1; // Read Numbers cin >> number2; // from keyboard sum = number1 + number2; average = sum/2; cout << ”Sum = “ << sum << “n”; cout << “Average = “ << average << “n”; return 0; } //end of example
  • 26. The output would be: Enter two numbers: 6.5 7.5 Sum = 14 Average = 7
  • 27. cin >> number1  Is an input statement and causes the program to wait for the user to type in a number. The number keyed in is placed in the variable number1.  The operator >> is known as extraction or get from operator.
  • 28. cout << ”Sum = “ << sum << “n”; Cascading of I/O Operators  The statement First sends the string “Sum = “ to cout and then sends the value of sum. Finally, it sends the newline character so that the next output will be in the new line. Using the cascading technique, the last two statements can be combined as follows: 1. Cout << “Sum = “ << sum << “n” << “Average = “ << average << “n”; 2. Cout << “Sum = “ << sum << “,” << “Average = “ << average << “n”;  We can also cascade input operator >> as shown below: Cin >> number1 >> number2;
  • 29. Example with Class  One of the major features of C++ is classes. They provide a method of binding together data and functions which operate on them. #include<iostream> // include header file using namespace std; class person { char name[30]; Int age; public: void getdata(void); void display(void); }; void person :: getdata(void) { cout << “Enter name: “; cin >> name; cout << “Enter age: “; cin >> age;
  • 30. Void person : : display(void) { cout << “nNameame: “ << name; cout << “nAge: “ << age; } Int main() { person p; p.getdata(); p.display(); Return 0; } //end of example The output of program is: Enter Name: Ravinder Enter age:30 Name:Ravinder Age: 30