Anu. S
anusdhar4@gmail.com
www.facebook.com/AnuSasidharan
twitter.com/username
in.linkedin.com/in/profilename
OOPS CONCEPT...
Disclaimer: This presentation is prepared by trainees of
baabtra as a part of mentoring program. This is not official
docu...
CONTENTS
OBJECT ORIENTED PROGRAMMING
DATAABSTRACTION
INHERITANCE
DATA ENCAPSULATION
POLYMORPHISM
EXAMPLE
OBJECT ORIENTED
PROGRAMMING
Object oriented programming approach views a
problem in terms of objects involved.
OBJECTS
An OBJECT is an identifiable entity with some
characteristics and behaviour.
Example: Orange
Characteristics: sphe...
CLASS
A CLASS is a group of objects that share common
properties and relationships
Example: a CAR can be considered as
a c...
EXAMPLE
class CS{
int studentid;
char name[100];
int totmks=0;
float avg;
int total(int marks[5])
{
for(i=0;i<5;i++)
{
tot...
DATA ABSTRACTION
DATAABSTRACTION
The act of representing essential features without including the
background details or explanations.
Examp...
INHERITANCE
The capability of
one class of
things to inherit
capabilities or
properties from
another class.
INHERITANCE
VEHICLES
automobiles Pulled vehicles
ENCAPSULATION
ENCAPSULATION
The wrapping up of data and operations or functions
into a single unit .
ENCAPSULATION
DEPARTMENT
PRODUCTION
PURCHASE
SALES
ACCOUNTS
MEMO
POLYMORPHISM
POLYMORPHISM
The ability for a data to be processed in more than one
form.
POLYMORPHISM
SHAPE
AREA()
CIRCLE
AREA(CIRCLE)
TRIANGLE
AREA(TRIANGLE)
RECTANGLE
AREA(RECTANGLE)
EXAMPLES
#include<iostream.h>
class Item{
int itemno;
float price;
public:
void getdata(int i,float j)
{
itemno=i;
price=j...
const int size=10;
Item order[size];
int main()
{
int ino;
float cost;
//get value for all items
for(int a=0;a<size;a++)
{...
Item 1
Itemno:111 price:155
Item 2
Itemno:125 price:89
Item 3
Itemno:201 price:95
Item 4
Itemno:352 price:213
Item 5
Itemn...
THANK YOU...
Want to learn more about programming or Looking to
become a good programmer? Are you wasting time on
searching so many con...
Follow us @ twitter.com/baabtra
Like us @ facebook.com/baabtra
Subscribe to us @ youtube.com/baabtra
Become a follower @ s...
Contact Us
Emarald Mall (Big Bazar Building)
Mavoor Road, Kozhikode,
Kerala, India.
Ph: + 91 – 495 40 25 550
NC Complex, N...
Oop cocepts
Upcoming SlideShare
Loading in …5
×

Oop cocepts

280 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
280
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Oop cocepts

  1. 1. Anu. S anusdhar4@gmail.com www.facebook.com/AnuSasidharan twitter.com/username in.linkedin.com/in/profilename OOPS CONCEPTS IN C++
  2. 2. Disclaimer: This presentation is prepared by trainees of baabtra as a part of mentoring program. This is not official document of baabtra –Mentoring Partner Baabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt . Ltd
  3. 3. CONTENTS OBJECT ORIENTED PROGRAMMING DATAABSTRACTION INHERITANCE DATA ENCAPSULATION POLYMORPHISM EXAMPLE
  4. 4. OBJECT ORIENTED PROGRAMMING Object oriented programming approach views a problem in terms of objects involved.
  5. 5. OBJECTS An OBJECT is an identifiable entity with some characteristics and behaviour. Example: Orange Characteristics: spherical shape orange colour Behaviour: juicy tastes sweet-sour
  6. 6. CLASS A CLASS is a group of objects that share common properties and relationships Example: a CAR can be considered as a class. Objects in this class involves the steering,wheels,engine. Properties involve the company,color,model,speed,engine capacity,etc
  7. 7. EXAMPLE class CS{ int studentid; char name[100]; int totmks=0; float avg; int total(int marks[5]) { for(i=0;i<5;i++) { totmks+=marks[i]; avg=totmks/5; } return balance; } }; class objects CS stud1,stud2;
  8. 8. DATA ABSTRACTION
  9. 9. DATAABSTRACTION The act of representing essential features without including the background details or explanations. Example: A calculator Only the results are displayed on the screen The user is unaware of its internal processing
  10. 10. INHERITANCE The capability of one class of things to inherit capabilities or properties from another class.
  11. 11. INHERITANCE VEHICLES automobiles Pulled vehicles
  12. 12. ENCAPSULATION
  13. 13. ENCAPSULATION The wrapping up of data and operations or functions into a single unit .
  14. 14. ENCAPSULATION DEPARTMENT PRODUCTION PURCHASE SALES ACCOUNTS MEMO
  15. 15. POLYMORPHISM
  16. 16. POLYMORPHISM The ability for a data to be processed in more than one form.
  17. 17. POLYMORPHISM SHAPE AREA() CIRCLE AREA(CIRCLE) TRIANGLE AREA(TRIANGLE) RECTANGLE AREA(RECTANGLE)
  18. 18. EXAMPLES #include<iostream.h> class Item{ int itemno; float price; public: void getdata(int i,float j) { itemno=i; price=j; } };
  19. 19. const int size=10; Item order[size]; int main() { int ino; float cost; //get value for all items for(int a=0;a<size;a++) { cout<<"Enter itemno & price for item"<<a+1<<"n"; cin>>ino>>cost; order[a].getdata(ino,cost); } return 0; }
  20. 20. Item 1 Itemno:111 price:155 Item 2 Itemno:125 price:89 Item 3 Itemno:201 price:95 Item 4 Itemno:352 price:213 Item 5 Itemno:444 price:250
  21. 21. THANK YOU...
  22. 22. Want to learn more about programming or Looking to become a good programmer? Are you wasting time on searching so many contents online? Do you want to learn things quickly? Do an online course @ baabtra.com. We provide development, testing and production environments just like in the industry to practice. The courses are so structured to make a quick, good software professional.
  23. 23. Follow us @ twitter.com/baabtra Like us @ facebook.com/baabtra Subscribe to us @ youtube.com/baabtra Become a follower @ slideshare.net/BaabtraMentoringPartner Connect to us @ in.linkedin.com/in/baabtra Thanks in advance. www.baabtra.com | www.massbaab.com |www.baabte.com
  24. 24. Contact Us Emarald Mall (Big Bazar Building) Mavoor Road, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550 NC Complex, Near Bus Stand Mukkam, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550 Cafit Square, Hilite Business Park, Near Pantheerankavu, Kozhikode Start up Village Eranakulam, Kerala, India. Email: info@baabtra.com

×