SlideShare a Scribd company logo
-A.Sujatha M.Sc.,M.Phil.,PGDCA.,
-M.Mohana Malar M.Sc., M.Phil.,
 The major motivating factor in the invention of object-
oriented approach is to remove some of the flaws
encountered in the procedural approach. OOP treats
data as a critical element in the program development
and does not allow it to flow freely around the system.
It ties data more closely to the function that operate on
it, and protects it from accidental modification from
outside function. OOP allows decomposition of a
problem into a number of entities called objects and
then builds data and function around these objects.
The data of an object can be accessed only by the
function associated with that object. However, function
of one object can access the function of other objects.
It is necessary to understand some of the
concepts used extensively in object-oriented
programming. These include:
 Objects
 Classes
 Data abstraction and encapsulation
 Inheritance
 Polymorphism
 Dynamic binding
 Message passing
OOP offers several benefits to both the program designer and the user. Object-
Orientation contributes to the solution of many problems associated with the development and
quality of software products. The new technology promises greater programmer productivity,
better quality of software and lesser maintenance cost. The principal advantages are:
 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 possible to have multiple instances of an object to co-exist without any interference.
 It is possible to map object in the problem domain to those in the program.
 It is easy to partition the work in a project based on objects.
 The data-centered design approach enables us to capture more detail of a model can
implemental form.
 Object-oriented system can be easily upgraded from small to large system.
 Message passing techniques for communication between objects makes to interface
descriptions with external systems much simpler.
 Software complexity can be easily managed.
OOP has become one of the programming buzzwords today. There appears to
be a great deal of excitement and interest among software engineers in using OOP.
Applications of OOP are beginning to gain importance in many areas. The most
popular application of object-oriented programming, up to now, has been in the
area of user interface design such as window. Hundreds of windowing systems
have been developed, using the OOP techniques.
Real-business system are often much more complex and contain many more
objects with complicated attributes and method. OOP is useful in these types of
application because it can simplify a complex problem. The promising areas of
application of OOP include:
 Real-time system
 Simulation and modeling
 Object-oriented data bases
 Hypertext, Hypermedia, and expertext
 AI and expert systems
 Neural networks and parallel programming
 Decision support and office automation systems
 CIM/CAM/CAD systems
We have used the following #include
directive in the program:
#include <iostream>
 The #include directive instructs the compiler
to include the contents of the file enclosed
within angular brackets into the source file.
The header file iostream.h should be included
at the beginning of all programs that use
input/output statements.
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. For using the identifier defined in the
namespace scope we must include the using
directive, like
Using namespace std;
Here, std is the namespace where ANSI C++
standard class libraries are defined. All ANSI C++
programs must include this directive. This will
bring all the identifiers defined in std to the
current global scope. Using and namespace are
the new keyword of C++.
 In C++, main () returns an integer value to
the operating system. Therefore, every main
() in C++ should end with a return (0)
statement; otherwise a warning an error
might occur. Since main () returns an integer
type for main () is explicitly specified as int.
Note that the default return type for all
function in C++ is int.
AVERAGE OF TWO NUMBERS
#include<iostream.h> // include header file
Using namespace std;
int main()
{
float number1, number2,sum, average;
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
 One of the major features of C++ is classes.
They provide a method of binding together
data and functions which operate on them.
Like structures in C, classes are user-defined
data types.
USE OF CLASS
#include<iostream.h> // 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: Arun
Enter age:30
Name:Arun
Age: 30

More Related Content

Similar to Programming in c++

Programming In C++
Programming In C++ Programming In C++
Programming In C++
shammi mehra
 
Part 1
Part 1Part 1
Bca 2nd sem u-1 iintroduction
Bca 2nd sem u-1 iintroductionBca 2nd sem u-1 iintroduction
Bca 2nd sem u-1 iintroduction
Rai University
 
T2
T2T2
T2
lksoo
 
OOPS_Unit_1
OOPS_Unit_1OOPS_Unit_1
OOPS_Unit_1
Shipra Swati
 
1 puc programming using c++
1 puc programming using c++1 puc programming using c++
1 puc programming using c++
Prof. Dr. K. Adisesha
 
A Hand Book of Visual Basic 6.0.pdf.pdf
A Hand Book of Visual Basic 6.0.pdf.pdfA Hand Book of Visual Basic 6.0.pdf.pdf
A Hand Book of Visual Basic 6.0.pdf.pdf
Ann Wera
 
Software_Engineering_Presentation (1).pptx
Software_Engineering_Presentation (1).pptxSoftware_Engineering_Presentation (1).pptx
Software_Engineering_Presentation (1).pptx
ArifaMehreen1
 
Lab manual object oriented technology (it 303 rgpv) (usefulsearch.org) (usef...
Lab manual object oriented technology (it 303 rgpv) (usefulsearch.org)  (usef...Lab manual object oriented technology (it 303 rgpv) (usefulsearch.org)  (usef...
Lab manual object oriented technology (it 303 rgpv) (usefulsearch.org) (usef...
Make Mannan
 
Vedic Calculator
Vedic CalculatorVedic Calculator
Vedic Calculator
divyang_panchasara
 
Introduction to object oriented language
Introduction to object oriented languageIntroduction to object oriented language
Introduction to object oriented languagefarhan amjad
 
Aspect Oriented Software Development
Aspect Oriented Software DevelopmentAspect Oriented Software Development
Aspect Oriented Software DevelopmentJignesh Patel
 
Documentation
DocumentationDocumentation
Documentation
Rajesh Seendripu
 
Object Oriented Programming using C++.pptx
Object Oriented Programming using C++.pptxObject Oriented Programming using C++.pptx
Object Oriented Programming using C++.pptx
parveen837153
 
Cs6301 programming and datastactures
Cs6301 programming and datastacturesCs6301 programming and datastactures
Cs6301 programming and datastacturesK.s. Ramesh
 
PROBLEM SOLVING
PROBLEM SOLVINGPROBLEM SOLVING
PROBLEM SOLVING
shahzadebaujiti
 
Stnotes doc 5
Stnotes doc 5Stnotes doc 5
Stnotes doc 5
Alok Jain
 

Similar to Programming in c++ (20)

Programming In C++
Programming In C++ Programming In C++
Programming In C++
 
Part 1
Part 1Part 1
Part 1
 
Bca 2nd sem u-1 iintroduction
Bca 2nd sem u-1 iintroductionBca 2nd sem u-1 iintroduction
Bca 2nd sem u-1 iintroduction
 
T2
T2T2
T2
 
OOPS_Unit_1
OOPS_Unit_1OOPS_Unit_1
OOPS_Unit_1
 
1 puc programming using c++
1 puc programming using c++1 puc programming using c++
1 puc programming using c++
 
A Hand Book of Visual Basic 6.0.pdf.pdf
A Hand Book of Visual Basic 6.0.pdf.pdfA Hand Book of Visual Basic 6.0.pdf.pdf
A Hand Book of Visual Basic 6.0.pdf.pdf
 
Software_Engineering_Presentation (1).pptx
Software_Engineering_Presentation (1).pptxSoftware_Engineering_Presentation (1).pptx
Software_Engineering_Presentation (1).pptx
 
Lab manual object oriented technology (it 303 rgpv) (usefulsearch.org) (usef...
Lab manual object oriented technology (it 303 rgpv) (usefulsearch.org)  (usef...Lab manual object oriented technology (it 303 rgpv) (usefulsearch.org)  (usef...
Lab manual object oriented technology (it 303 rgpv) (usefulsearch.org) (usef...
 
Vedic Calculator
Vedic CalculatorVedic Calculator
Vedic Calculator
 
Topic 1 PBO
Topic 1 PBOTopic 1 PBO
Topic 1 PBO
 
Introduction to object oriented language
Introduction to object oriented languageIntroduction to object oriented language
Introduction to object oriented language
 
Aspect Oriented Software Development
Aspect Oriented Software DevelopmentAspect Oriented Software Development
Aspect Oriented Software Development
 
Documentation
DocumentationDocumentation
Documentation
 
Object Oriented Programming using C++.pptx
Object Oriented Programming using C++.pptxObject Oriented Programming using C++.pptx
Object Oriented Programming using C++.pptx
 
Cs6301 programming and datastactures
Cs6301 programming and datastacturesCs6301 programming and datastactures
Cs6301 programming and datastactures
 
PROBLEM SOLVING
PROBLEM SOLVINGPROBLEM SOLVING
PROBLEM SOLVING
 
06 fse design
06 fse design06 fse design
06 fse design
 
Software engineering
Software engineeringSoftware engineering
Software engineering
 
Stnotes doc 5
Stnotes doc 5Stnotes doc 5
Stnotes doc 5
 

More from sujathavvv

Vector calculus
Vector calculusVector calculus
Vector calculus
sujathavvv
 
Complex analysis
Complex analysisComplex analysis
Complex analysis
sujathavvv
 
Z transforms
Z transformsZ transforms
Z transforms
sujathavvv
 
Formatted Console I/O Operations in C++
Formatted Console I/O Operations in C++Formatted Console I/O Operations in C++
Formatted Console I/O Operations in C++
sujathavvv
 
Programming in c++ ppt
Programming in c++ pptProgramming in c++ ppt
Programming in c++ ppt
sujathavvv
 
Vector calculus
Vector calculusVector calculus
Vector calculus
sujathavvv
 
Complex analysis
Complex analysisComplex analysis
Complex analysis
sujathavvv
 
Trigonometry & vector calculus
Trigonometry & vector calculusTrigonometry & vector calculus
Trigonometry & vector calculus
sujathavvv
 
Complex analysis
Complex analysisComplex analysis
Complex analysis
sujathavvv
 
Differential equation and Laplace Transform
Differential equation and Laplace TransformDifferential equation and Laplace Transform
Differential equation and Laplace Transform
sujathavvv
 
Differential equation and Laplace transform
Differential equation and Laplace transformDifferential equation and Laplace transform
Differential equation and Laplace transform
sujathavvv
 
Sequences and Series
Sequences and SeriesSequences and Series
Sequences and Series
sujathavvv
 
Sequences and Series
Sequences and SeriesSequences and Series
Sequences and Series
sujathavvv
 
Programming in C
Programming in CProgramming in C
Programming in C
sujathavvv
 
Programming in c
Programming in cProgramming in c
Programming in c
sujathavvv
 

More from sujathavvv (15)

Vector calculus
Vector calculusVector calculus
Vector calculus
 
Complex analysis
Complex analysisComplex analysis
Complex analysis
 
Z transforms
Z transformsZ transforms
Z transforms
 
Formatted Console I/O Operations in C++
Formatted Console I/O Operations in C++Formatted Console I/O Operations in C++
Formatted Console I/O Operations in C++
 
Programming in c++ ppt
Programming in c++ pptProgramming in c++ ppt
Programming in c++ ppt
 
Vector calculus
Vector calculusVector calculus
Vector calculus
 
Complex analysis
Complex analysisComplex analysis
Complex analysis
 
Trigonometry & vector calculus
Trigonometry & vector calculusTrigonometry & vector calculus
Trigonometry & vector calculus
 
Complex analysis
Complex analysisComplex analysis
Complex analysis
 
Differential equation and Laplace Transform
Differential equation and Laplace TransformDifferential equation and Laplace Transform
Differential equation and Laplace Transform
 
Differential equation and Laplace transform
Differential equation and Laplace transformDifferential equation and Laplace transform
Differential equation and Laplace transform
 
Sequences and Series
Sequences and SeriesSequences and Series
Sequences and Series
 
Sequences and Series
Sequences and SeriesSequences and Series
Sequences and Series
 
Programming in C
Programming in CProgramming in C
Programming in C
 
Programming in c
Programming in cProgramming in c
Programming in c
 

Recently uploaded

Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Po-Chuan Chen
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 

Recently uploaded (20)

Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 

Programming in c++

  • 2.  The major motivating factor in the invention of object- oriented approach is to remove some of the flaws encountered in the procedural approach. OOP treats data as a critical element in the program development and does not allow it to flow freely around the system. It ties data more closely to the function that operate on it, and protects it from accidental modification from outside function. OOP allows decomposition of a problem into a number of entities called objects and then builds data and function around these objects. The data of an object can be accessed only by the function associated with that object. However, function of one object can access the function of other objects.
  • 3. It is necessary to understand some of the concepts used extensively in object-oriented programming. These include:  Objects  Classes  Data abstraction and encapsulation  Inheritance  Polymorphism  Dynamic binding  Message passing
  • 4. OOP offers several benefits to both the program designer and the user. Object- Orientation contributes to the solution of many problems associated with the development and quality of software products. The new technology promises greater programmer productivity, better quality of software and lesser maintenance cost. The principal advantages are:  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 possible to have multiple instances of an object to co-exist without any interference.  It is possible to map object in the problem domain to those in the program.  It is easy to partition the work in a project based on objects.  The data-centered design approach enables us to capture more detail of a model can implemental form.  Object-oriented system can be easily upgraded from small to large system.  Message passing techniques for communication between objects makes to interface descriptions with external systems much simpler.  Software complexity can be easily managed.
  • 5. OOP has become one of the programming buzzwords today. There appears to be a great deal of excitement and interest among software engineers in using OOP. Applications of OOP are beginning to gain importance in many areas. The most popular application of object-oriented programming, up to now, has been in the area of user interface design such as window. Hundreds of windowing systems have been developed, using the OOP techniques. Real-business system are often much more complex and contain many more objects with complicated attributes and method. OOP is useful in these types of application because it can simplify a complex problem. The promising areas of application of OOP include:  Real-time system  Simulation and modeling  Object-oriented data bases  Hypertext, Hypermedia, and expertext  AI and expert systems  Neural networks and parallel programming  Decision support and office automation systems  CIM/CAM/CAD systems
  • 6. We have used the following #include directive in the program: #include <iostream>  The #include directive instructs the compiler to include the contents of the file enclosed within angular brackets into the source file. The header file iostream.h should be included at the beginning of all programs that use input/output statements.
  • 7. 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. For using the identifier defined in the namespace scope we must include the using directive, like Using namespace std; Here, std is the namespace where ANSI C++ standard class libraries are defined. All ANSI C++ programs must include this directive. This will bring all the identifiers defined in std to the current global scope. Using and namespace are the new keyword of C++.
  • 8.  In C++, main () returns an integer value to the operating system. Therefore, every main () in C++ should end with a return (0) statement; otherwise a warning an error might occur. Since main () returns an integer type for main () is explicitly specified as int. Note that the default return type for all function in C++ is int.
  • 9. AVERAGE OF TWO NUMBERS #include<iostream.h> // include header file Using namespace std; int main() { float number1, number2,sum, average; 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
  • 10.  One of the major features of C++ is classes. They provide a method of binding together data and functions which operate on them. Like structures in C, classes are user-defined data types.
  • 11. USE OF CLASS #include<iostream.h> // 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
  • 12. The output of program is: Enter Name: Arun Enter age:30 Name:Arun Age: 30