0% found this document useful (0 votes)
56 views52 pages

Unit 1 - 2 Lecture Notes Oops C++

Uploaded by

algebra5317
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views52 pages

Unit 1 - 2 Lecture Notes Oops C++

Uploaded by

algebra5317
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 52

Introduction:

Procedure Oriented Programming Language

3
“Object ori

creating copies of such modules on demand”.

Data is hidden and can’t be accessed by externa



ble to express the operation of addition by a single operater say ‘+’. When this is possible you
This principle of data hiding helps the programmer to build secure programs that can’t be


C ++ was early called ‘C with classes’.

/* ….*/ are still valid and more suitable for multi line comments.

The statement cout <<”Hello, world” displayed the string with in quotes on the screen. The identifier

iostream.h represents that stream. The insertion operator << also called the ‘put to’ operator directs
cout<<”sum=”<<sum<<” n”;
cout<<”sum=”<<sum<<” n”<<”average=”<<average<<” n”;


·
·
·
·
out<<”enter name”;

out<<”enter age”;

out<<” n name:”<<name;
out<<” n age:”<<age;
identifiers and can’t be used as names for the program variables or other user defi
The name can’t start with a digit.

A declared keyword can’t be used as a variable name.



can’t be modified by the program in any way.

’ n’;

<<” ”

out<<” n”;
<<” ”<<
<<” ”<<
<<” ”<<

<<” ”<<
<<” ”<<
<<” ”<<
if… else statement
’*’,

<<” ”<<
‘=’
• Outside the class definition
• Inside the class function

‘ ’

<<” ”<<
<<” ”<<

•S


<<“ ”<<
<<” ”<<

<<” ”<<

<<” ”<<
<<” ”

<<” ”

<<” ”<<
<<” ”<<
<<” ”

<<” ”<< <<” ”


Cout<<endl<<”model:”<<
<<” ”<<
<<” ”<<” ”
<<” ”

<<” ”

<<”_”

<<” ”<<
<<” ”<<” ”

”11’ ”
’ ”
<<” ”

<<” ”

<<” ”;
<<” me”

<<” ”<<e

<<” ”
<<” ”<<
<<” ”<<
<<” ”<<

<<” ”

<<” ”
<<” ”
<<” ”

<<” ”
“ ”<<

<<” ”
<<” ”
<<” 1 :add an item’’
<<” ”
<<” ”
<<” ”
<<” ”
<<” ”

<<” ”
<<” ”
<<” “

<<” ”<<
<<” ”

<<” ”<<
<<” ”

<<” ”

<<” ”

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy