Introduction to OOP. Procedural Programming sequence of statements to solve a problem.

Similar documents
Microsoft Visual Basic 2005: Reloaded

Intro to OOP Visibility/protection levels and constructors Friend, convert constructor, destructor Operator overloading a<=b a.

C++ Important Questions with Answers

C++ Programming: Introduction to C++ and OOP (Object Oriented Programming)

What are the characteristics of Object Oriented programming language?

Advanced Programming Using Visual Basic 2008

Chapter 5 Object-Oriented Programming

What is Inheritance?

OOPS Viva Questions. Object is termed as an instance of a class, and it has its own state, behavior and identity.

9/21/2010. Based on Chapter 2 in Advanced Programming Using Visual Basic.NET by Bradley and Millspaugh

Inheritance and Polymorphism

OOPs Concepts. 1. Data Hiding 2. Encapsulation 3. Abstraction 4. Is-A Relationship 5. Method Signature 6. Polymorphism 7. Constructors 8.

Programming Language Concepts Object-Oriented Programming. Janyl Jumadinova 28 February, 2017

OBJECT ORIENTED PROGRAMMING

Oops known as object-oriented programming language system is the main feature of C# which further support the major features of oops including:

(11-1) OOP: Inheritance in C++ D & D Chapter 11. Instructor - Andrew S. O Fallon CptS 122 (October 29, 2018) Washington State University

Object oriented programming. Encapsulation. Polymorphism. Inheritance OOP

Chapter 13 Object Oriented Programming. Copyright 2006 The McGraw-Hill Companies, Inc.

Object-Oriented Programming. Objects. Objects. Objects

CGS 2405 Advanced Programming with C++ Course Justification

CREATED BY: Muhammad Bilal Arslan Ahmad Shaad. JAVA Chapter No 5. Instructor: Muhammad Naveed

Concepts of Programming Languages

Design issues for objectoriented. languages. Objects-only "pure" language vs mixed. Are subclasses subtypes of the superclass?

Object-Oriented Languages and Object-Oriented Design. Ghezzi&Jazayeri: OO Languages 1

1. Write two major differences between Object-oriented programming and procedural programming?

Object Oriented Programming: Based on slides from Skrien Chapter 2

CHAPTER 5 GENERAL OOP CONCEPTS


Object oriented programming Concepts

Sri Vidya College of Engineering & Technology


Java Object Oriented Design. CSC207 Fall 2014

Inheritance, and Polymorphism.

Advantages of Object Oriented Programming :- Features of Object Oriented Programming :- Advantages Of Object Oriented Programming :

What is a Programming Paradigm

Compaq Interview Questions And Answers

Lecture Contents CS313D: ADVANCED PROGRAMMING LANGUAGE. What is Inheritance?

Object-Oriented Programming

Chapter 11. Categories of languages that support OOP: 1. OOP support is added to an existing language

QUIZ. Write the following for the class Bar: Default constructor Constructor Copy-constructor Overloaded assignment oper. Is a destructor needed?

Object-Oriented Programming

JAVA MOCK TEST JAVA MOCK TEST II

ASSIGNMENT NO 13. Objectives: To learn and understand concept of Inheritance in Java

CS313D: ADVANCED PROGRAMMING LANGUAGE

Software Development. Modular Design and Algorithm Analysis

Inheritance -- Introduction

Chapter 12 Object-Oriented Programming. Starting Out with Games & Graphics in C++ Tony Gaddis

02 Features of C#, Part 1. Jerry Nixon Microsoft Developer Evangelist Daren May President & Co-founder, Crank211

Lesson 10B Class Design. By John B. Owen All rights reserved 2011, revised 2014

SEEM4570 System Design and Implementation. Lecture 11 From Design to Implementation

Lecture 13: Object orientation. Object oriented programming. Introduction. Object oriented programming. OO and ADT:s. Introduction

Programming in C# Inheritance and Polymorphism

C++ (Non for C Programmer) (BT307) 40 Hours

Chapter3: Introduction to Classes and Objects

Data Abstraction. Hwansoo Han

ECE 122. Engineering Problem Solving with Java

PROGRAMMING LANGUAGE 2

Data Structures (list, dictionary, tuples, sets, strings)

Lecture 10 OOP and VB.Net

Zhifu Pei CSCI5448 Spring 2011 Prof. Kenneth M. Anderson

Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub

CS111: PROGRAMMING LANGUAGE II

Object Oriented Programming. C++ 6 th Sem, A Div Ms. Mouna M. Naravani

Lecture Notes on Programming Languages

CS-202 Introduction to Object Oriented Programming

Paytm Programming Sample paper: 1) A copy constructor is called. a. when an object is returned by value

Classes, objects, methods and properties

Object Oriented Programming is a programming method that combines: Advantage of Object Oriented Programming

Computer Science II (20073) Week 1: Review and Inheritance

Inheritance and Encapsulation. Amit Gupta

CS5000: Foundations of Programming. Mingon Kang, PhD Computer Science, Kennesaw State University

CSI33 Data Structures

INHERITANCE & POLYMORPHISM. INTRODUCTION IB DP Computer science Standard Level ICS3U. INTRODUCTION IB DP Computer science Standard Level ICS3U

Get Unique study materials from

Computer Science 4U Unit 1. Programming Concepts and Skills Modular Design

Objects. Prof. Clarkson Fall ob-ject: to feel distaste for something Webster's Dictionary. Today s music: Kung Fu Fighting by CeeLo Green

Object Oriented Programming. Assistant Lecture Omar Al Khayat 2 nd Year

CLASSES AND OBJECTS IN JAVA

More On inheritance. What you can do in subclass regarding methods:

Object Oriented Programming with c++ Question Bank

Programming II (CS300)

Lecture 3. COMP1006/1406 (the Java course) Summer M. Jason Hinek Carleton University

Microsoft Visual Basic 2005: Reloaded

Unit - IV CHAPTER - 13 INTRODUCTION TO OOP WITH C++ Part 1 Choose the best answer

Programming Exercise 14: Inheritance and Polymorphism

Object Oriented Software Development CIS Today: Object Oriented Analysis

CS313D: ADVANCED PROGRAMMING LANGUAGE

Polymorphism. Contents. Assignment to Derived Class Object. Assignment to Base Class Object

OVERRIDING. 7/11/2015 Budditha Hettige 82

MaanavaN.Com CS1203 OBJECT ORIENTED PROGRAMMING DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

Introduction to Object-Oriented Programming

BCS THE CHARTERED INSTITUTE FOR IT. BCS HIGHER EDUCATION QUALIFICATIONS BCS Level 5 Diploma in IT OBJECT ORIENTED PROGRAMMING

Data Structure. Recitation III

Data Structures (INE2011)

A base class (superclass or parent class) defines some generic behavior. A derived class (subclass or child class) can extend the base class.

CPS 506 Comparative Programming Languages. Programming Language

Overview of OOP. Dr. Zhang COSC 1436 Summer, /18/2017

(5-1) Object-Oriented Programming (OOP) and C++ Instructor - Andrew S. O Fallon CptS 122 (February 4, 2019) Washington State University

Object Oriented Programming in Java. Jaanus Pöial, PhD Tallinn, Estonia

Abstract Classes. Abstract Classes a and Interfaces. Class Shape Hierarchy. Problem AND Requirements. Abstract Classes.

Transcription:

Introduction to OOP C++ - hybrid language improved and extended standard C (procedural language) by adding constructs and syntax for use as an object oriented language. Object-Oriented and Procedural Programming Procedural Programming sequence of statements to solve a problem. Design Technique Functional Decomposition - Top-down design Create a structure chart - Problem is broken into several tasks. Each of these is in turn further decomposed into more sub-tasks. This approach defers the details as long as possible. Upper levels are very general, lower levels are more specific. Algorithm - pseudo code is written for each module to determine the precise step by step instructions to perform that task. Advantage - intuitive and orderly Disadvantage maintenance changes tend to cascade through the program. Object Oriented Programming Design Technique Object Oriented Design - OOD Create a hierarchy of objects - Problem is broken down into objects (entities or things) that are needed in the problem. The code that causes these objects to interact is the driver program (also called the client). Object class - Description of a group of objects with similar properties and behaviors; a pattern for creating individual objects (template). They share properties, features, or attributes. 08/25/18 1

Example : Student adding a course: Functional Decomposition - Focus on actions repeat select a course if the course is open add the course increment credits until credits > 12 OOD - Focus on objects that are operated on Obj. attributes operations student name gpa banner-id add course credits drop course update credits course name add number drop credits seat count max current seat count Relationships among and between objects has a - student has a banner-id faculty has a banner-id staff has a banner-id is a student is a person faculty is a person staff is a person belongs to Slim Pickens belongs to (or is an instance of) student 08/25/18 2

Classes and Abstract Data Types class C++ construct to declare and define objects - data members variables or fields that maintain information about object - function members/methods actions or processes that operate or reveal the data member values Information Hiding The practice of hiding the implementation details with the goal of controlling access to the details and simplifying the use of the software. interface vs. implementation Example: CD player interface : buttons, volume, input slot, song number implementation: components inside C++ - keywords public and private control access to class members Encapsulation The practice of combining data and procedures to manipulate the data into a package. Abstract Data Type A data-type that employs encapsulation and information hiding to only expose in the interface the high-level operations and hide all low-level implementation details. It allows the programmer (user) to abstract from ignore the implementation details. Promotes program reliability and robustness 08/25/18 3

The Client/Server Model and Message Passing Inheritance and Polymorphism Inheritance Objects (classes) can stand alone or be part of an inheritance hierarchy. This creates relationships between classes (is a). Example: Student is a Person Student inherits all attributes of Person (name, birthdate ) C++ supports multiple inheritance a child class (derived class) can inherit attributes from more than one parent class (base class) 08/25/18 4

Polymorphism Having many forms Within an inheritance hierarchy there can be function members that have the same signature (i.e. invocation of the function is identical). Derived class function members override a parent class function member when they have an identical signature. Example: Person class has a Print() Student class has a Print() Person p; Student s; p.print(); // calls the print in person s.print(); // calls the print in student Interfaces and Components Interface The exposed high-level methods for a class (typically in a.h file) Component The hidden implementation details for a class (typically in a.o file) The programmer (class user) can refer to the interface information for how to communicate and integrate the objects. The necessary components can be placed in a container that make up the application. 08/25/18 5