Professional Documents
Culture Documents
Project On C++: Satya College of Engineering & Technology
Project On C++: Satya College of Engineering & Technology
Project on C++
Submitted to :Neha Mangla by:11 Click to edit Master subtitle style
Submitted
12/9/12
Contents:
22
History of C++ Object Oriented Programming Features of OOP OOP Characteristics The basics of C++ Program Data types and Expression Operators Conditional Constructs
12/9/12
History of C++
C++
Incorporated C
33
12/9/12
major motivating factor in the invention of the object oriented approach is to remove some flaws encountered in the procedural approach. treats data as a critical element in the program development and does not allow it flow freely around the system. ties data more closely to the functions that operate on it, and protects it from accidental modification from outside functions. allows decomposition of a problem into a number of entities called objects and then builds
OOP
It
OOP
44
12/9/12
Features of OOP
Emphasis
is on data rather than procedure. are divided into what are known as objects. that operate on the data of an object are tied together in the data structure. is hidden and cannot be accessed by external functions .
55
Programs
Functions
Data
12/9/12
OOP Characteristics
Encapsulation
Information Objects
hiding
Inheritance
Writing Objects
reusable code
Polymorphism
12/9/12
language
symbols ( +
! )
symbols
words
77
reserved (int,
12/9/12
Example Program
#include <iostream> int main() { cout<<"Welcome to C++ Programming"<<endl; return 0; }
Program Output
12/9/12
Integers Floating
Enumeration An
expression includes
combined
12/9/12
Operators
Arithmetic Arithmetic Unary
Comparison Logical
operators(&&,||)
10 10
12/9/12
Conditional Constructs
If
Switch
IF .else construct:IF conditional construct is followed by logical expression where data is compared and decision is made based on the result of the comparison . Syntax if(exp.) {statements;}
11 11
12/9/12
Conditional Constructs(contd)
Switch
..case constructs
When the switch statement is executed its condition variable is evaluated and compared with each case constants . Syntax switch (variable _name) { case 1: Statements;
12 12
12/9/12
Loop constructs
A loop is construct that causes a section of a program to be repeated a certain no. of times.
The The The The
while Loop do.while Loop for Loop Construct break and continue Statements
The while Loop:The while loop continues until the evaluating condition becomes false.
13 13
12/9/12
14 14
12/9/12
loop constructs:-
The for loop constructs provides a compact way of specifying the statements that control the repetition of steps within the loop. Syntax:-
For (initialization;condition;increment/decrement)
{statements;}
15 15
12/9/12
Thank You
16 16