Lecture 1-Overview-1
Lecture 1-Overview-1
Technology
IT 8113: OBJECT ORIENTED PROGRAMMING
Quiz---------------------------------5%
Assignments -----------------------5%
4/4/2024
IT 8113: Object oriented programming 2
Introduction
➢ It aims at binding together data and function work on these data sets
into a single entity to restrict their usage.
4/4/2024
IT 8113: Object oriented programming 3
Introduction
CLASS
OBJECTS
ENCAPSULATION
POLYMORPHISM
INHERITANCE
ABSTRACTION
4/4/2024
IT 8113: Object oriented programming 4
Introduction
4/4/2024
IT 8113: Object oriented programming 5
Introduction
1. The core library includes the data types, variables and literals, etc.
2. The standard library includes the set of functions manipulating
strings, files, etc.
3. The Standard Template Library (STL) includes the set of methods
manipulating a data structure.
4/4/2024
IT 8113: Object oriented programming 6
Introduction
Usage of C++
➢ By the help of C++ programming language, we can develop different
types of secured and robust applications:
1. Window application
2. Client-Server application
3. Device drivers
4. Embedded firmware etc
4/4/2024
IT 8113: Object oriented programming 7
Introduction
C++ Features
1. Simple
➢ C++ is a simple language because it provides a structured approach (to
break the problem into parts)
2. Abstract Data types
➢ In C++, complex data types called Abstract Data Types (ADT) can be
created using classes.
3. Portable
➢ C++ is a portable language and programs made in it can be run on
different machines.
4/4/2024
IT 8113: Object oriented programming 8
Introduction
4/4/2024
IT 8113: Object oriented programming 9
Introduction
6. Pointer
➢ C++ provides the feature of pointers. We can use pointers for
memory, structures, functions, array, etc.
7. Recursion
➢ In C++, we can call the function within the function. It provides code
reusability for every function.
8. Reusability
➢ With the use of inheritance of functions programs written in C++ can
be reused in any other program of C++
9. Errors are easily detected: It is easier to maintain a C++ programs
as errors can be easily located and rectified
4/4/2024
IT 8113: Object oriented programming 10
Introduction
C++ Program
➢ Open the C++ console and write the following code:
#include <iostream>
Using name space std:
int main() {
clrscr();
cout << "Welcome to C++ Programming.";
return(0);
}
4/4/2024
IT 8113: Object oriented programming 11
Introduction
void main() The main() function is the entry point of every program in
C++ language. The void keyword specifies that it returns no value.
4/4/2024
IT 8113: Object oriented programming 12
Introduction
4/4/2024
IT 8113: Object oriented programming 13
Introduction
Basic Input/Output
I/O operation is using the stream concept. Stream is the sequence of
bytes or flow of data. It makes the performance fast.
4/4/2024
IT 8113: Object oriented programming 14
Introduction
Basic Input/Output
<iostream> It is used to define the cout, cin and cerr objects, which
correspond to standard output stream, standard input
stream and standard error stream, respectively.
4/4/2024
IT 8113: Object oriented programming 15
Introduction
4/4/2024
IT 8113: Object oriented programming 16
Introduction
#include <iostream>
using namespace std;
int main( ) {
char ary[] = "Welcome to C++ tutorial";
cout << "Value of ary is: " << ary << endl;
}
Output:
Value of ary is: Welcome to C++ tutorial
4/4/2024
IT 8113: Object oriented programming 17
Introduction
4/4/2024
IT 8113: Object oriented programming 18
Introduction
4/4/2024
IT 8113: Object oriented programming 20
Introduction
Variable
➢ A variable is a name of memory location. It is used to store data. Its
value can be changed and it can be reused many times.
4/4/2024
IT 8113: Object oriented programming 21
Introduction
Variable cont…..
➢ We can also provide values while declaring the variables as given
below:
4/4/2024
IT 8113: Object oriented programming 22
Introduction
4/4/2024
IT 8113: Object oriented programming 23
Introduction
int a; int 4;
int _ab; int x y;
int a30; int double;
4/4/2024
IT 8113: Object oriented programming 24
Introduction
Data Types
There are 4 types of data types
4/4/2024
IT 8113: Object oriented programming 25
Introduction
4/4/2024
IT 8113: Object oriented programming 26
Introduction
4/4/2024
IT 8113: Object oriented programming 27
Introduction
Operators
An operator is simply a symbol that is used to perform operations
The following are types of operators to perform different types of
operations.
❖ Arithmetic Operators
❖ Relational Operators
❖ Logical Operators
❖ Bitwise Operators
❖ Assignment Operator
❖ Unary operator
❖ Ternary or Conditional Operator
❖ Misc Operator
4/4/2024
IT 8113: Object oriented programming 28
Introduction
Identifiers
➢ Identifiers in a program are used to refer to the name of the
variables, functions, arrays, or other user-defined data types created
by the programmer.
➢ Every language has its own rules for naming the identifiers.
4/4/2024
IT 8113: Object oriented programming 29
Introduction
4/4/2024
IT 8113: Object oriented programming 30
Introduction
4/4/2024
IT 8113: Object oriented programming 31
Introduction
4/4/2024
IT 8113: Object oriented programming 32
Introduction
4/4/2024
IT 8113: Object oriented programming 33
Introduction
➢ In the above code, we declare two variables 'a' and 'A'. Both the
letters are same but they will behave as different identifiers.
➢ As we know that the identifiers are the case-sensitive so both the
identifiers will have different memory locations.
Output
4/4/2024
IT 8113: Object oriented programming 34
Introduction
Expression
➢ Expression consists of operators, constants, and variables which are
arranged according to the rules of the language.
➢ It can also contain function calls which return values. An expression
can consist of one or more operands, zero or more operators to
compute a value.
4/4/2024
IT 8113: Object oriented programming 35
Introduction
Expression
➢ Expression consists of operators, constants, and variables which are
arranged according to the rules of the language.
➢ It can also contain function calls which return values. An expression
can consist of one or more operands, zero or more operators to
compute a value.
4/4/2024
IT 8113: Object oriented programming 36
Introduction
Expression
An expression can be of following types:
1. Constant expressions
2. Integral expressions
3. Float expressions
4. Pointer expressions
5. Relational expressions
6. Logical expressions
7. Bitwise expressions
8. Special assignment expressions
4/4/2024
IT 8113: Object oriented programming 37
Introduction
4/4/2024
IT 8113: Object oriented programming 38
Introduction
4/4/2024
IT 8113: Object oriented programming 40
Thank you for Listening! Questions
4/4/2024 41
IT 8113: Object oriented programming