INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING

Slides:



Advertisements
Similar presentations
Understand and appreciate Object Oriented Programming (OOP) Objects are self-contained modules or subroutines that contain data as well as the functions.
Advertisements

Agenda Definitions Evolution of Programming Languages and Personal Computers The C Language.
Department of Computer Engineering Faculty of Engineering, Prince of Songkla University 1 5 – Abstract Data Types.
Classes & Objects Computer Science I Last updated 9/30/10.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
1 Introduction to C++ Programming Concept Basic C++ C++ Extension from C.
WEL COME PRAVEEN M JIGAJINNI PGT (Computer Science) MCA, MSc[IT], MTech[IT],MPhil (Comp.Sci), PGDCA, ADCA, Dc. Sc. & Engg.
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
C++ fundamentals.
Distribution of Marks Internal Sessional Evaluation Assignments – 10 Quizzes – 10 Class Participation Attendence – 5 Mid – Term Test – 25 External Evaluation.
OBJECT ORIENTED PROGRAMMING IN C++ LECTURE
1 INTRODUCTION TO OOP Objective: Know the difference between functional programming and OOP Know basic terminology in OOP Know the importance of OOP Know.
1 INTRODUCTION TO OOP Objective: Know the difference between functional programming and OOP Know basic terminology in OOP Know the importance of OOP Know.
OOP- OBJECT OBJECT PROGRAMMING By KRATI SHARMA 02 XI-B ✏✏✏✏ ☺☻☺☻☺☻☺ ✏✏✏✏
Object Oriented Programming Development
Microsoft Visual Basic 2005: Reloaded Second Edition
Introduction to Object-oriented programming and software development Lecture 1.
GENERAL CONCEPTS OF OOPS INTRODUCTION With rapidly changing world and highly competitive and versatile nature of industry, the operations are becoming.
O BJECT O RIENTATION F UNDAMENTALS Prepared by: Gunjan Chhabra.
C++ Programming Basic Learning Prepared By The Smartpath Information systems
1 Programming Paradigms Object Orientated Programming Paradigm (OOP)
Introduction to c++ programming - object oriented programming concepts - Structured Vs OOP. Classes and objects - class definition - Objects - class scope.
Learners Support Publications Object Oriented Programming.
Programming Paradigms Lecturer Hamza Azeem. What is PP ? Revision of Programming concepts learned in CPLB Learning how to perform “Object-Oriented Programming”
Java Fundamentals Usman Ependi UBD
نظام المحاضرات الالكترونينظام المحاضرات الالكتروني Introduction to Object Oriented Programming (OOP) Object Oriented programming is method of programming.
Programming and Languages Dept. of Computer and Information Science IUPUI.
Introduction to OOP CPS235: Introduction.
Lesson 1 1 LESSON 1 l Background information l Introduction to Java Introduction and a Taste of Java.
Object Oriented Paradigm OOP’s. Problems with Structured Programming As programs grow ever larger and more complex, even the structured programming approach.
 Description of Inheritance  Base Class Object  Subclass, Subtype, and Substitutability  Forms of Inheritance  Modifiers and Inheritance  The Benefits.
Introduction to Object Oriented Programming Lecture-3.
 By the end of this lecture, you should …  Understand the three pillars of Object- Oriented Programming: Inheritance, Encapsulation and Polymorphism.
Object-oriented programming (OOP) is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their.
Lecture 2 (UNIT -1) SUNIL KUMAR CIT-UPES.
OOP - Object Oriented Programming
Programming paradigms
What is an Object Objects are key to understanding object-oriented technology. An object can be considered a "thing" that can perform a set of related.
Object-Orientated Programming
Visit for more Learning Resources
Object Oriented Programming
Object-Oriented Programming Concepts
Sachin Malhotra Saurabh Choudhary
Concepts of Object Oriented Programming
OOP: Object-oriented programming
Sections Basic Concepts of Programming
Classes and OOP.
Object-Oriented Analysis and Design
Programming in Java Sachin Malhotra, Chairperson, PGDM-IT, IMS Ghaziabad Saurabh Chaudhary, Dean, Academics, IMS Ghaziabad.
Inheritance Modern object-oriented (OO) programming languages provide 3 capabilities: encapsulation inheritance polymorphism which can improve the design,
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING (OOP) & CONCEPTS
INTRODUCTION TO OOP Objective:
PRINCIPALES OF OBJECT ORIENTED PROGRAMMING
Lecture 1 Introduction.
Computer Programming.
PROGRAMMING PARADIGMS
Lecture 22 Inheritance Richard Gesick.
Procedural Programming
Object-Oriented Programming
Object oriented vs procedural programming
Object-Oriented Programming
Introduction to Object-Oriented Programming
Object-Oriented Programming
Workshop for Programming And Systems Management Teachers
What Is Good Software(Program)?
Object-Oriented PHP (1)
CS 2704 Object Oriented Software Design and Construction
Final and Abstract Classes
Object-Oriented Programming
Object Oriented Programming (OOP)- Assist. Prof. Dr
Presentation transcript:

INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING A. Vιgиєsh Kuмαя

Alpha Breathing (1 Mins) The three steps for alpha breathing are Breathe in Breathe out Hold (Repeat the three steps for 8 times) Vιgиєsh Kuмαя 5/15/2018

RECAP (5 min) Vιgиєsh Kuмαя 5/15/2018

Evocation (3 mins) Vιgиєsh Kuмαя 5/15/2018

PROGRAMMING LANGUAGES Programming languages allow programmers to code software. The three major families of languages are: Machine languages. Assembly languages. High-Level languages. Vιgиєsh Kuмαя 5/15/2018

MACHINE LANGUAGES Comprised of 1s and 0s The “native” language of a computer Difficult to program – one misplaced 1 or 0 will cause the program to fail. Example of code: 1110100010101 111010101110 10111010110100 10100011110111 Vιgиєsh Kuмαя 5/15/2018

ASSEMBLY LANGUAGES Assembly languages are a step towards easier programming. Assembly languages are comprised of a set of elemental commands which are tied to a specific processor. Assembly language code needs to be translated to machine language before the computer processes it. Example: ADD 1001010, 1011010

HIGH-LEVEL LANGUAGES High-level languages represent a giant leap towards easier programming. The syntax of HL languages is similar to English. Historically, we divide HL languages into two groups: Procedural languages Object-Oriented languages (OOP) Vιgиєsh Kuмαя 5/15/2018

PROCEDURAL LANGUAGES A program in a procedural language is basically a list of instructions. As programs become larger they are usually broken down into smaller units, such as functions, procedures, subroutines. Functions can be grouped together into modules according to their functionality, objectives and tasks. Structured programming is a programming paradigm that to a large extent relies on the idea of dividing a program into functions and modules. Vιgиєsh Kuмαя 5/15/2018

PROBLEMS WITH STRUCTURED PROGRAMMING Functions have unrestricted access to global data Function A: Function B: Function C: local data local data local data global data X global data Y global data Z Large number of potential connections between functions and data it is difficult to tell which functions access the data

PROBLEMS WITH STRUCTURED PROGRAMMING Data and function are considered as two separate entities. Makes it difficult to model things in the real world. Complex real world objects have both attributes and behaviours. Attributes People: name, date of birth, eye color, job title. Cars: horse power, number of doors, color. Behaviours People: ask a person to bring you a coffee. Cars: apply the brakes, turn on the engine. Vιgиєsh Kuмαя 5/15/2018

OBJECT ORIENTED PROGRAMMING class - collections of objects object- instance of class

OBJECT ORIENTED APPROACH-Characteristics of OOPS data functions Encapsulation: integrate data and functions into one object. Data items are called attributes or instance variables .

OBJECT ORIENTED APPROACH Separation: objects interact with each other only via the their membership functions. Separation helps to maintain the integrity of the entire Program. Object A data functions Object C data functions Object B data functions

Abstraction Abstraction is the concept of taking some object from the real world, and converting it to programming terms. Create a Human class and giving it int health, int age, String name, etc. properties, and eat() etc. methods. Vιgиєsh Kuмαя 5/15/2018

CLASSES VERSUS OBJECTS A class is a prototype specification from which one can generate a number of similar objects. A class can be considered as an object factory. An object is said to be a member or instance of a class.

INHERITANCE In our daily lives we use the concept of classes divided into subclasses, for example vehicles are divided into cars,trucks, buses and motor cycles. The principle in this sort of division is that each sub-class shares some common features with the base class from which it is derived, but also has its own particular features. base class Vehicle wheels engine Car Truck wheels engine trunk wheels engine trailer sub-classes or derived classes trunk trailer

REUSABILITY Reusability means that a class that has been designed, created and debugged once can be distributed to other programmers for use in their own programs. The concept of inheritance provides an important extension to the idea of reusability, as it allows a programmer to take an existing class without modifying it and adding additional features and functionality. This is done by inheriting a new sub-class from the exisiting base class.

POLYMORPHISM & OVERLOADING Polymorphism means ”having many shapes”. A polymorphic variable can refer to objects of Different classes, for example a graphic object can Be either a circle or a triangle. Overloading: an existing operator, such as + or = is given The capability to operate on a new data type, for example Define the operator + for the class complex such that It realizes the addition of two complex numbers.

WHY OOP? Modularization Abstraction Encapsulation Portability Hierarchy Continuity

Procedure Oriented Programming Object Oriented Programming Divided Into In POP, program is divided into small parts called functions. In OOP, program is divided into parts called objects. Importance In POP,Importance is not given to data but to functions as well as sequence of actions to be done. In OOP, Importance is given to the data rather than procedures or functions because it works as a real world. Approach POP follows Top Down approach. OOP follows Bottom Up approach. Access Specifiers POP does not have any access specifier. OOP has access specifiers named Public, Private, Protected, etc. Data Moving In POP, Data can move freely from function to function in the system. In OOP, objects can move and communicate with each other through member functions.

Expansion To add new data and function in POP is not so easy. OOP provides an easy way to add new data and function. Data Access In POP, Most function uses Global data for sharing that can be accessed freely from function to function in the system. In OOP, data can not move easily from function to function, it can be kept public or private so we can control the access of data. Data Hiding POP does not have any proper way for hiding data so it is less secure. OOP provides Data Hiding so provides more security. Overloading In POP, Overloading is not possible. In OOP, overloading is possible in the form of Function Overloading and Operator Overloading. Examples Example of POP are : C, VB, FORTRAN, Pascal. Example of OOP are : C++, JAVA, VB.NET, C#.NET.

C++ Programming Basics Basic program Construction: #include <iostream> using namespace std; int main() { cout << “Welcome to CSE Department \n”; return 0; } Every C++ program has one function name called main() Main() is where the program execution starts.

Functions Collection of statements to do some particular task. Functions separate the concept (what is done) from the implementation (how it is done). Functions make programs easier to understand. Functions can be called several times in the same program, allowing the code to be reused.

Functions Functions are one of the fundamental building blocks of C++. The above program consists almost entirely of a single function called main(). The only parts of this program that are not part of the function are the first two lines—the ones that start with #include and using.

Braces and the Function Body The body of a function is surrounded by braces. These braces play the same role as the BEGIN and END keywords in some other languages. Every function must use this pair of braces around the function body.

Always start with main() When we run a C++ program, the first statement executed will be at the beginning of a function called main(). The program may consist of many functions, classes, and other program elements, but on startup, control always goes to main(). If there is no function called main() in your program, an error will be reported when we run the program.

Discussion (10 mins) Vιgиєsh Kuмαя 5/15/2018

Mind Map (7 mins) Polymorphism Structured Programming Encapsulation Object Oriented Programming Data Hiding Abstraction Inheritance Class & Objects

Summary/ presentation (3 mins) Vιgиєsh Kuмαя 5/15/2018

STIMULATING QUESTIONS Identify the type of application for which object oriented programming can be used. Can you list some scenario where procedural language is still being the best? Vιgиєsh Kuмαя 5/15/2018

Vιgиєsh Kuмαя 5/15/2018