SlideShare a Scribd company logo
1 of 16
PRESENTATION
OF C++
TOPIC : ABSTRACTION
C++
Submitted to :
Jyoti Kaurav Mam
NAME KRISHAN KUMAR CHAUHAN
ROLL NO 215/ICS/054
PROGRAMME NAME INTEGRATED B.TECH-M.TECH (CSE)
COURSE NAME PROBLEM SOLVING USING C++
COURSE CODE CS207
TABLE OF CONTANTS
4
1. TOPIC
2. INTRODUCTION
3. SYNTAX
4. PROGRAM
5. APPLICATION
6. CONSEQUENCES
TOPIC
5
ABSTRACTION
Abstraction refers to the act of representing the crucial requisite
features without including the additional explanations of such
features. Hence, it means providing the end-user with their needs but
without the details of how the needs were fulfilled.
For instance, we know how the switches at our houses work. Say for
the fans, we just simply turn on the switch if we want to switch it on,
or turn off the switch if we want to switch it off. In the case of fans,
we can even use the regulator to adjust the speed according to our
needs.Thus, we know all the features but we don’t know what the
background implementation is.This is a real-life example of data
abstraction.
INTRODUCTION
Abstraction is a process that is important to the creation of
computer programs.
In this presentation we are going to talk about the nature of abstraction with
regards to Object Orientation.
There are 2 types of abstraction in C++:
1. Data Abstraction: It hides the information about the data.
2. Control Abstraction: It hides the information about the implementation.
Abstract Classes
# In C++ we can make use of abstract classes to provide structure with no possibility of
implementation.
#These classes provide the necessary contract for C++ to make use of dynamic binding
in a system.
#These classes known as concrete class.
Abstraction:
# Process of successively filtering out low level details.
# Replace with a high level view of system interactions.
# Helped by the use of diagrams and other notations (URL and such).
# Important skill in gaining big picture understanding of how classes interact.
Abstract Classes
In C++ abstract classes created using special syntax for class
declaration:
abstract class Student {
private String matriculationCode;
private String name;
private String address;
public Student (String m. String n, String a) {
matriculation Code = m;
name = n;
address = a;
}
public String getName() { return name:
{
public String getCode() { return mainculationCode.
}
public String getAddress() { return address,
}
}
Abstract Classes
Individual methods all possible to declare as abstract:
abstract class Student {
private String matriculation Code;
Private String name;
private String address;
public Student (String m, Sting n, String a) {
matriculation Code=m;
name=n;
address=a;
}
public String getName() { return name:
}
public String getCode()
return matriculationCode;
}
public String getAddress() {
return address;
}
abstract public int getLoan(): abstract public String getStatus():
}
PROGRAM USING ABSTRACTION CLASS
// C++ Program to Demonsate the
// working of Abstraction
#include <iostream>
using namespace std;
class implementAbstraction {
private:
int a, b;
public:
// method to set values of
// private members
void set(int x, int y)
{
a = x;
b = y;
}
void display()
{
cout << "a = " << a << endl;
cout << "b = " << b << endl;
}
};
int main()
{
implementAbstraction obj;
obj.set(10, 20);
obj.display();
return 0;
}
Output
a = 10
b = 20
….You can see in the above program we are not allowed to access the
variables a and b directly, however, one can call the function set() to set
the values in a and b and the function display() to display the values of a
and b.
APPLICATIONS OF ABSTRACTION
1. Abstraction increases the reusability of the code because of the proper
partitioning.
2. It reduces the complexity as well as the redundancy of the code, hence increasing
the readability.
3. Using classes and objects increases the security of the code.We can declare the
parts of the code as private to keep them secure.
4. Due to abstraction, the important parts of the code are secure as only the
essential features are provided to the user and they don’t know the background
details.
5. Since the programmer can use the same code repeatedly, it helps us perform
similar tasks for similar operations.
6. Abstraction allows changing internal implementations without affecting its user-
level code.
CONSIQUENCIES OF ABSTRACTION
Naturally, abstractions are a "good thing" for the most part, but if they're badly done,
they can be disasterous. Even if they're well-done, they have a cost as relates to raw
performance:
• Simple speed. In order to execute an abstraction, the code implementing needs to
handle cases and situations which may not always be needed - or often aren't
needed - by many usage scenarios.This will typically make code using the
abstractions slower than it would be if the code directly implemented the operation
without using the abstraction.
• Code size.This rarely matters on larger systems nowadays, but it can be a significant
problem in small devices or constrained environments.The extra code needed to
fully implement an abstraction adds linecount and ultimately code size, and if the
code isn't carefully implemented, can end up "pulling in" lots of extra code, leading to
overlarge runtime executables and ultimately making the device itself more
expensive.
THANKYOU
BY – KRISHAN KUMAR CHAUHAN
215/ICS/054

More Related Content

Similar to Abstraction

I assignmnt(oops)
I assignmnt(oops)I assignmnt(oops)
I assignmnt(oops)Jay Patel
 
OOP-Advanced Programming with c++
OOP-Advanced Programming with c++OOP-Advanced Programming with c++
OOP-Advanced Programming with c++Mohamed Essam
 
C Sharp: Basic to Intermediate Part 01
C Sharp: Basic to Intermediate Part 01C Sharp: Basic to Intermediate Part 01
C Sharp: Basic to Intermediate Part 01Zafor Iqbal
 
Programming in Java: Why Object-Orientation?
Programming in Java: Why Object-Orientation?Programming in Java: Why Object-Orientation?
Programming in Java: Why Object-Orientation?Martin Chapman
 
Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...
Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...
Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...NicheTech Com. Solutions Pvt. Ltd.
 
Java programming concept
Java programming conceptJava programming concept
Java programming conceptSanjay Gunjal
 
Introduction to Java -unit-1
Introduction to Java -unit-1Introduction to Java -unit-1
Introduction to Java -unit-1RubaNagarajan
 
Virtual Function and Polymorphism.ppt
Virtual Function and Polymorphism.pptVirtual Function and Polymorphism.ppt
Virtual Function and Polymorphism.pptishan743441
 
Bca winter 2013 2nd sem
Bca winter 2013 2nd semBca winter 2013 2nd sem
Bca winter 2013 2nd semsmumbahelp
 
Oo Design And Patterns
Oo Design And PatternsOo Design And Patterns
Oo Design And PatternsAnil Bapat
 
An Introduction to the SOLID Principles
An Introduction to the SOLID PrinciplesAn Introduction to the SOLID Principles
An Introduction to the SOLID PrinciplesAttila Bertók
 
Interface in java By Dheeraj Kumar Singh
Interface in java By Dheeraj Kumar SinghInterface in java By Dheeraj Kumar Singh
Interface in java By Dheeraj Kumar Singhdheeraj_cse
 
Interoduction to c++
Interoduction to c++Interoduction to c++
Interoduction to c++Amresh Raj
 

Similar to Abstraction (20)

I assignmnt(oops)
I assignmnt(oops)I assignmnt(oops)
I assignmnt(oops)
 
OOP in java
OOP in javaOOP in java
OOP in java
 
OOP-Advanced Programming with c++
OOP-Advanced Programming with c++OOP-Advanced Programming with c++
OOP-Advanced Programming with c++
 
C Sharp: Basic to Intermediate Part 01
C Sharp: Basic to Intermediate Part 01C Sharp: Basic to Intermediate Part 01
C Sharp: Basic to Intermediate Part 01
 
Ppt of c vs c#
Ppt of c vs c#Ppt of c vs c#
Ppt of c vs c#
 
Programming in Java: Why Object-Orientation?
Programming in Java: Why Object-Orientation?Programming in Java: Why Object-Orientation?
Programming in Java: Why Object-Orientation?
 
Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...
Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...
Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...
 
Java programming concept
Java programming conceptJava programming concept
Java programming concept
 
Introduction to Java -unit-1
Introduction to Java -unit-1Introduction to Java -unit-1
Introduction to Java -unit-1
 
iOS Application Development
iOS Application DevelopmentiOS Application Development
iOS Application Development
 
Virtual Function and Polymorphism.ppt
Virtual Function and Polymorphism.pptVirtual Function and Polymorphism.ppt
Virtual Function and Polymorphism.ppt
 
Python-DataAbstarction.pptx
Python-DataAbstarction.pptxPython-DataAbstarction.pptx
Python-DataAbstarction.pptx
 
Bca winter 2013 2nd sem
Bca winter 2013 2nd semBca winter 2013 2nd sem
Bca winter 2013 2nd sem
 
Oo Design And Patterns
Oo Design And PatternsOo Design And Patterns
Oo Design And Patterns
 
An Introduction to the SOLID Principles
An Introduction to the SOLID PrinciplesAn Introduction to the SOLID Principles
An Introduction to the SOLID Principles
 
C++ Version 2
C++  Version 2C++  Version 2
C++ Version 2
 
Unit 1
Unit  1Unit  1
Unit 1
 
Interface in java By Dheeraj Kumar Singh
Interface in java By Dheeraj Kumar SinghInterface in java By Dheeraj Kumar Singh
Interface in java By Dheeraj Kumar Singh
 
c++ referesher 1.pdf
c++ referesher 1.pdfc++ referesher 1.pdf
c++ referesher 1.pdf
 
Interoduction to c++
Interoduction to c++Interoduction to c++
Interoduction to c++
 

Recently uploaded

Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...RKavithamani
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 

Recently uploaded (20)

Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 

Abstraction

  • 3. NAME KRISHAN KUMAR CHAUHAN ROLL NO 215/ICS/054 PROGRAMME NAME INTEGRATED B.TECH-M.TECH (CSE) COURSE NAME PROBLEM SOLVING USING C++ COURSE CODE CS207
  • 4. TABLE OF CONTANTS 4 1. TOPIC 2. INTRODUCTION 3. SYNTAX 4. PROGRAM 5. APPLICATION 6. CONSEQUENCES
  • 5. TOPIC 5 ABSTRACTION Abstraction refers to the act of representing the crucial requisite features without including the additional explanations of such features. Hence, it means providing the end-user with their needs but without the details of how the needs were fulfilled. For instance, we know how the switches at our houses work. Say for the fans, we just simply turn on the switch if we want to switch it on, or turn off the switch if we want to switch it off. In the case of fans, we can even use the regulator to adjust the speed according to our needs.Thus, we know all the features but we don’t know what the background implementation is.This is a real-life example of data abstraction.
  • 6. INTRODUCTION Abstraction is a process that is important to the creation of computer programs. In this presentation we are going to talk about the nature of abstraction with regards to Object Orientation. There are 2 types of abstraction in C++: 1. Data Abstraction: It hides the information about the data. 2. Control Abstraction: It hides the information about the implementation.
  • 7. Abstract Classes # In C++ we can make use of abstract classes to provide structure with no possibility of implementation. #These classes provide the necessary contract for C++ to make use of dynamic binding in a system. #These classes known as concrete class.
  • 8. Abstraction: # Process of successively filtering out low level details. # Replace with a high level view of system interactions. # Helped by the use of diagrams and other notations (URL and such). # Important skill in gaining big picture understanding of how classes interact.
  • 9. Abstract Classes In C++ abstract classes created using special syntax for class declaration: abstract class Student { private String matriculationCode; private String name; private String address; public Student (String m. String n, String a) { matriculation Code = m; name = n; address = a; } public String getName() { return name: { public String getCode() { return mainculationCode. } public String getAddress() { return address, } }
  • 10. Abstract Classes Individual methods all possible to declare as abstract: abstract class Student { private String matriculation Code; Private String name; private String address; public Student (String m, Sting n, String a) { matriculation Code=m; name=n; address=a; } public String getName() { return name: } public String getCode() return matriculationCode; } public String getAddress() { return address; } abstract public int getLoan(): abstract public String getStatus(): }
  • 11. PROGRAM USING ABSTRACTION CLASS // C++ Program to Demonsate the // working of Abstraction #include <iostream> using namespace std; class implementAbstraction { private: int a, b; public: // method to set values of // private members void set(int x, int y) { a = x; b = y; }
  • 12. void display() { cout << "a = " << a << endl; cout << "b = " << b << endl; } }; int main() { implementAbstraction obj; obj.set(10, 20); obj.display(); return 0; } Output a = 10 b = 20
  • 13. ….You can see in the above program we are not allowed to access the variables a and b directly, however, one can call the function set() to set the values in a and b and the function display() to display the values of a and b.
  • 14. APPLICATIONS OF ABSTRACTION 1. Abstraction increases the reusability of the code because of the proper partitioning. 2. It reduces the complexity as well as the redundancy of the code, hence increasing the readability. 3. Using classes and objects increases the security of the code.We can declare the parts of the code as private to keep them secure. 4. Due to abstraction, the important parts of the code are secure as only the essential features are provided to the user and they don’t know the background details. 5. Since the programmer can use the same code repeatedly, it helps us perform similar tasks for similar operations. 6. Abstraction allows changing internal implementations without affecting its user- level code.
  • 15. CONSIQUENCIES OF ABSTRACTION Naturally, abstractions are a "good thing" for the most part, but if they're badly done, they can be disasterous. Even if they're well-done, they have a cost as relates to raw performance: • Simple speed. In order to execute an abstraction, the code implementing needs to handle cases and situations which may not always be needed - or often aren't needed - by many usage scenarios.This will typically make code using the abstractions slower than it would be if the code directly implemented the operation without using the abstraction. • Code size.This rarely matters on larger systems nowadays, but it can be a significant problem in small devices or constrained environments.The extra code needed to fully implement an abstraction adds linecount and ultimately code size, and if the code isn't carefully implemented, can end up "pulling in" lots of extra code, leading to overlarge runtime executables and ultimately making the device itself more expensive.
  • 16. THANKYOU BY – KRISHAN KUMAR CHAUHAN 215/ICS/054