Object Oriented Programming
Object Oriented Programming
CONTENTS
❖ Object Oriented Programming
❖ Concept Of Object Oriented Programming
❖ Basic Object-Oriented Programming
❖ Data Members
❖ Members Function
❖ Advantages of OOPs
❖ Simple String Program
❖ Simple Integer Program
❖ Simple Character Program
❖ Simple Float Program
Concept Of Object Oriented Programming
Coop is a Programming pattern where the programs are structured around objects rather than
functions and logic.
It makes the data partitioned into two memory areas, i.e., data and functions, and helps make
the code flexible and modular.
Object-oriented programming mainly focuses on objects that are required to be manipulated.
In OOPs, it can represent data as objects that have attributes and functions.
Object Oriented Programming
Basic Object-Oriented Programming
❑ Object-An O Object can be defined as an entity that has a state and behavior is called an
object.
It can represent a dog, a person, a table, etc.
An object means the combination of data and programs, which further represent an entity.
• Member functions are the functions used to affect these variables and together these data members and member
functions defines the properties and behavior of the objects in a Class.
Advantages of OOPs
int main()
{
int var1, var2;
Int var1 = 20;
var2 = var1 + 10 ;
cout << "var2 is = ";
cout << var2<<endl;
return 0;
}
Simple Character Program
#include<iostream>
using namespace std;
int main()
{
char charvar1 = 'A';
char chrvar2 = '\t’;
//charvar1 = 'B';
cout << charvar1;
cout << '\n';
return 0;
}
Simple Float Program
#include <iostream>
using namespace std;
int main()
{
return 0;
}