Object Oriented Programming

Slides:



Advertisements
Similar presentations
Chapter 13 – Introduction to Classes
Advertisements

Introduction to Programming Lecture 31. Operator Overloading.
C++ Classes & Data Abstraction
EEM 480 Algorithms and Complexity by Assist. Prof. Dr. Emin Germen.
1 CS 201 Introduction to c++ (1) Debzani Deb. 2 History of C++ Extension of C (C++ for better C) Early 1980s: Bjarne Stroustrup (Bell Laboratories) Provides.
C++ data types. Structs vs. Classes C++ Classes.
Introduction to Data Structures, Spring 2007 Slide- 1 California State University, Fresno Introduction to Data Structure Object Oriented Programming Concepts.
1 Introduction to C++ Programming Concept Basic C++ C++ Extension from C.
C++ fundamentals.
 By Wayne Cheng.  Introduction  Five Tenets  Terminology  The foundation of C++: Classes.
1 C++ Structures Starting to think about objects...
COMPUTER PROGRAMMING. Introduction to C++ History Merges notions from Smalltalk and notions from C The class concept was borrowed from Simular67 Developed.
Java and C++, The Difference An introduction Unit - 00.
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 24P. 1Winter Quarter C++ Lecture 24.
1 Chapter 13 Introduction to Classes. 2 Topics 12.1 Procedural and Object-Oriented Programming 12.2 Introduction to Classes 12.3 Defining an Instance.
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 13 Introduction to Classes.
C++ Introduction : C++ compilation. Visual Studio 2008 : Creating Command-Line Program.
Classes In C++ 1. What is a class Can make a new type in C++ by declaring a class. A class is an expanded concept of a data structure: instead of holding.
Information Systems Engineering
C++ Programming Basic Learning Prepared By The Smartpath Information systems
I/O and Data Formatting Introduction to Class Concepts INFSY 307 Spring 2003 Lecture 3.
Object Oriented Programming (OOP) Lecture No. 11.
CSC241 Object-Oriented Programming (OOP) Lecture No. 4.
Chapter 10 Classes and Objects In-Depth. Chapter 10 A class provides the foundation for creating specific objects, each of which shares the general attributes,
Introduction to c++ programming - object oriented programming concepts - Structured Vs OOP. Classes and objects - class definition - Objects - class scope.
1 Classes and Data Abstraction 2 Objectives Understand encapsulation and data hiding Understand data abstraction and Abstract Data Types (ADTs) Create.
Console Programs Console programs are programs that use text to communicate with the use and environment – printing text to screen, reading input from.
1 OOP - An Introduction ISQS 6337 John R. Durrett.
نظام المحاضرات الالكترونينظام المحاضرات الالكتروني Introduction to Object Oriented Programming (OOP) Object Oriented programming is method of programming.
Object-Oriented Programming (OOP) What we did was: (Procedural Programming) a logical procedure that takes input data, processes it, and produces output.
1 CSE Programming in C++. 2 Overview Sign roster list Syllabus and Course Policies Introduction to C++ About Lab 1 Fill Questionnaire.
Object Oriented Programming Session # 03.  Abstraction: Process of forming of general and relevant information from a complex scenarios.  Encapsulation:
Basic Concepts of OOP.  Object-Oriented Programming (OOP) is a type of programming added to php5 that makes building complex, modular and reusable web.
Exceptions and Handling
Starting Out with C++, 3 rd Edition 1 Chapter 13 – Introduction to Classes Procedural and Object-Oriented Programming Procedural programming is a method.
Structure A Data structure is a collection of variable which can be same or different types. You can refer to a structure as a single variable, and to.
Computer Programming II Lecture 4. Functions - In C++ we use modules to divide the program into smaller and manageable code. These modules are called.
Liang, Introduction to C++ Programming, (c) 2007 Pearson Education, Inc. All rights reserved X 1 Chapter 9 Introduction of Object Oriented Programming.
Seventh step for Learning C++ Programming CLASS Declaration Public & Private Constructor & Destructor This pointer Inheritance.
Data Structures Lecture 4: Classes in C++ Azhar Maqsood NUST Institute of Information Technology (NIIT)
Computer Programming II Lecture 5. Introduction to Object Oriented Programming (OOP) - There are two common programming methods : procedural programming.
Lecture 3 (UNIT -1) SUNIL KUMAR CIT-UPES.
Class and Objects UNIT II.
Inheritance CMSC 202, Version 4/02.
C++ Classes & Object Oriented Programming
Road Map Introduction to object oriented programming. Classes
Object-Orientated Programming
C++.
(5 - 1) Object-Oriented Programming (OOP) and C++
Object Oriented Analysis and Design
Object Oriented Programming
Object-Oriented Programming
Introduction to Programming
(5 - 1) Object-Oriented Programming (OOP) and C++
Object-Oriented Programming (OOP) Lecture No. 22
UNIT I OBJECT ORIENTED PROGRAMMING FUNDAMENTALS
From C to C++: Summary of weeks 1 - 4
C++ Programming ㅎㅎ String OOP Class Constructor & Destructor.
Object oriented programming (OOP) Lecture No. 7
Introduction to Programming
Object-Oriented Programming
By Rajanikanth B OOP Concepts By Rajanikanth B
Capitolo 1 – Introduction C++ Programming
Object Oriented JSL Techniques for Writing Maintainable/Extendable JSL Code DREW FOGLIA.
C++ Programming CLASS This pointer Static Class Friend Class
CPP Programming Language
Instructor: Dr. Michael Geiger Spring 2017 Lecture 12: Exam 1 Preview
C++ data types.
Object Oriented Programming(OOP)
Object Oriented Programming (OOP) Lecture No. 12
Presentation transcript:

Object Oriented Programming Lecture 14 Object Oriented Programming

Introduction What is object oriented programming? Example: Abstraction Encapsulation Inheritance Example: Think about an object in real world  Mobile

Structure We define struct in previous lecture. You can encapsulate data about an object in a new data type. Example:

Class Classes are an expanded concept of data structures they can contain data members. they can also contain functions as members. Function show behavior of an object.

Example

Example

Public and Private attribute/Function Object can have attribute with private access and public access from outside of view. Think about mobile. What is public? What is private? So we can have several type of access in OOP.

Syntax

Define and usage To define an object from class: Example <class name> <object name>; Example Usage: like structs: . Operator for normal object. -> operator for pointer object.

Initialization and destroy We can define two special function: First: when execute, initialize object. Second: when execute, destroy object. Syntax: Initializer: A function without data type and same name of class. Destroyer: A function without data type, ~same name of class

Example

Example

Input Output in C++ We can use cin and cout for input/output in c++. Syntax: For input: cin>> variable_name; For output Cout<< variable_name;

Overloading Can we define two function with same name? Yes, but parameter must be different.

What is wrong?