Escolar Documentos
Profissional Documentos
Cultura Documentos
PROGRAMMING
IN C++
Objective
Goal
Upon the completion of the session,
you should be able to know
Structured Programming ~Object
Oriented Programming
Software Retrospection and Need
of OOPs
OOPs- Characteristics
Classes and Objects
C++
Emphasis on Data
Programs are divided
into Objects
Data is hidden and
highly protected
Objects communicate
each other using
functions
Bottom-up Approach
OOPs Definition
Comments
#include <iostream>
1. Comments
Written between /* and */ or following
a //.
4
5
int main()
1. 2. Load <iostream>
preprocessor directive
cout << "Welcome to C++!<<endl;
3. main
return 0;
10 }
Welcome to C++!
// Addition program
#include <iostream>
4
5
int main()
// declaration
8
9
// prompt
10
// read an integer
11
12
13
14
cout << "Sum is " << sum << endl; // print sum
return 0;
// read an integer
// assignment of sum
integer"
2.3.1 Get input2.4 Add
variables and put result into
15
16
1. Load <iostream>
2. 2. main
2.1 Initialize variables
integer1, integer2,
and sum
17 }