Data Structures and Programming with C++

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


BASIC CONCEPT OF OOP


Object Oriented Programming using C++

Data Structures and Programming with C++

PROGRAMMING IN C++ COURSE CONTENT

STUDY NOTES UNIT 1 - INTRODUCTION TO OBJECT ORIENTED PROGRAMMING

Data Structures and Programming with C++

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

Object Oriented Pragramming (22316)

OBJECT ORIENTED PROGRAMMING

Object-Oriented Programming (OOP) Fundamental Principles of OOP

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

Inheritance and Polymorphism

Inheritance and Polymorphism

Sri Vidya College of Engineering & Technology

Unit 1 : Principles of object oriented programming

Object-Oriented Programming

XII CS(EM) Minimum Question List N.KANNAN M.Sc., B.Ed COMPUTER SCIENCE IMPORTANT QUESTION (TWO MARKS) CHAPTER 1 TO 5 ( STAR OFFICE WRITER)

What are the characteristics of Object Oriented programming language?

SRM ARTS AND SCIENCE COLLEGE SRM NAGAR, KATTANKULATHUR

Index. Course Outline. Grading Policy. Lab Time Distribution. Important Instructions

Elementary Concepts of Object Class

Object Orientated Analysis and Design. Benjamin Kenwright

Examples. Object Orientated Analysis and Design. Benjamin Kenwright

Course Syllabus C # Course Title. Who should attend? Course Description

Lesson Plan. Subject: OBJECT ORIENTED PROGRAMMING USING C++ :15 weeks (From January, 2018 to April,2018)

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

Data Structures using OOP C++ Lecture 3

CSI33 Data Structures

Part 7 - Object Oriented Concepts Classes, Objects, Properties and Methods


CS 6456 OBJCET ORIENTED PROGRAMMING IV SEMESTER/EEE

Object Oriented Programming. Solved MCQs - Part 2

Dr. Md. Humayun Kabir CSE Department, BUET

Chapter3: Introduction to Classes and Objects

CGS 2405 Advanced Programming with C++ Course Justification

C++ Important Questions with Answers

B.C.A 2017 OBJECT ORIENTED PROGRAMMING USING C++ BCA303T MODULE SPECIFICATION SHEET

MAHALAKSHMI ENGINEERING COLLEGE B TIRUCHIRAPALLI

CLASSES AND OBJECTS IN JAVA

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

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

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

I BCS-031 BACHELOR OF COMPUTER APPLICATIONS (BCA) (Revised) Term-End Examination. June, 2015 BCS-031 : PROGRAMMING IN C ++

Object-Oriented Concepts and Principles (Adapted from Dr. Osman Balci)

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING OBJECT ORIENTED PROGRAMMING CLASS : THIRD SEMESTER CSE

Programming in C# with Microsoft Visual Studio 2010

Lecture 1. Abstraction

2559 : Introduction to Visual Basic.NET Programming with Microsoft.NET

Object Oriented Programming with c++ Question Bank

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

Jaipur National University, Jaipur Dr. Rajendra Takale Prof. and Head Academics SBPIM, Pune

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

PROGRAMMING IN VISUAL BASIC WITH MICROSOFT VISUAL STUDIO Course: 10550A; Duration: 5 Days; Instructor-led

Chapter 5 Object-Oriented Programming

G Programming Languages Spring 2010 Lecture 6. Robert Grimm, New York University

VB.NET. Exercise 1: Creating Your First Application in Visual Basic.NET

"Charting the Course... MOC Programming in C# with Microsoft Visual Studio Course Summary

This module reviews the core syntax and features of the C# programming language. It also provides an introduction to the Visual Studio 2012 debugger.

Object-Oriented Programming

Course Syllabus. Course Title. Who should attend? Course Description. ASP.NET ( Level 1 )

STRUCTURING OF PROGRAM

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

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

The University Of Michigan. EECS402 Lecture 06. Andrew M. Morgan. Savitch Ch. 6 Intro To OOP Classes Objects ADTs.

Basics of Object Oriented Programming. Visit for more.

M Introduction to Visual Basic.NET Programming with Microsoft.NET 5 Day Course

Introduction... ix. Chapter 1: Exploring Fundamental Programming Concepts... 1

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

Object Oriented Programming

A201 Object Oriented Programming with Visual Basic.Net

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

Programming in Visual Basic with Microsoft Visual Studio 2010

JAVA: A Primer. By: Amrita Rajagopal

10266 Programming in C Sharp with Microsoft Visual Studio 2010

Object Oriented Programming

XII- COMPUTER SCIENCE VOL-II MODEL TEST I

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

Programming Exercise 14: Inheritance and Polymorphism

PRACTICAL LIST FOR EVEN SEMESTERS (PGDCA/MCA/MSC (CS))

Element: Relations: Topology: no constraints.

Object Oriented Programming With C By Balagurusamy 5th Edition

DEVELOPING WINDOWS APPLICATIONS WITH MICROSOFT VISUAL STUDIO 2010

2609 : Introduction to C# Programming with Microsoft.NET

OBJECT ORIENTED SYSTEM DEVELOPMENT Software Development Dynamic System Development Information system solution Steps in System Development Analysis

Object oriented programming Concepts

VALLIAMMAI ENGINEERING COLLEGE

25. Generic Programming

Inheritance and Polymorphism

Developing Microsoft.NET Applications for Windows (Visual Basic.NET)

DOWNLOAD PDF CORE JAVA APTITUDE QUESTIONS AND ANSWERS

INFORMATION TECHNOLOGY COURSE OBJECTIVE AND OUTCOME

STUDENT LESSON A5 Designing and Using Classes

Model 4.2 Faculty member + student Course syllabus for Advanced programming language - CS313D

26. Interfaces. Java. Fall 2009 Instructor: Dr. Masoud Yaghini

Objects First with Java A Practical Introduction using BlueJ

Object Model. Object Orientated Analysis and Design. Benjamin Kenwright

(800) Toll Free (804) Fax Introduction to Java and Enterprise Java using Eclipse IDE Duration: 5 days

Transcription:

Data Structures and Programming with C++ By Dr. Atul Kumar Dwivedi ETC, BIT, Durg UNIT-I B. E., V Semester

Outline Basic concepts of Object oriented Programming (OOPs) 1. Objects 2. Classes 3. Data encapsulation 4. Data abstraction 5. Inheritance 6. Polymorphism 7. Dynamic binding 8. Message passing Benefits of OOPs Applications of OOPs Quiz Lab exercise 2

1. Objects Objects are run time entities related to a person, place or thing that have some specific features. Objects take space in the system memory and have some address associated with the memory. The data and functions of an object are stored in the class. Class 3

2. Classes Class specifies the data and functions related to objects. The entire set of data and code of an object can be made a userdefined data type with the help of class In fact, objects are variables of the type class. Once a class has been defined, we can create any number of objects belonging to that class. Each object is associated with the data of type class with which they are created. A class is thus a collection of objects similar types. 4

2. Classes (Example) For examples, Mango, Apple and orange members of class fruit. Classes are user-defined that types and behave like the built-in types of a programming language. The syntax used to create an object is not different then the syntax used to create an integer object in C. If fruit has been defines as a class, then the statement Fruit Mango; Will create an object mango belonging to the class fruit. 5

3. Data Encapsulation The wrapping up of data and functions into a single unit (called class) is known as encapsulation. Encapsulation helps in data hiding and protection. Data protection help the programmer as well user by providing data security Functions Data Class 6

4. Data Abstraction Data abstraction refers to, providing only needed information to the outside world and hiding implementation details. For example, consider a class Complex with public functions as getreal() and getimag(). We may implement the class as an array of size 2 or as two variables. The advantage of abstractions is, we can change implementation at any point, users of Complex class wont t be affected as out method interface remains same. Had our implementation be public, we would not have been able to change it. 7

5. Inheritance inheritance is the process by which objects of one class acquire the properties of objects of another class. It supports the concept of hierarchical classification. Inheritance provides re usability. This means that we can add additional features to an existing class without modifying it. 8

5. Inheritance(Example) 9

6.Polymorphism polymorphism means ability to take more than one form. An operation may exhibit different behaviors in different instances. The behavior depends upon the types of data used in the operation. C++ supports operator overloading and function overloading. Operator overloading is the process of making an operator to exhibit different behaviors in different instances is known as operator overloading. Function overloading is using a single function name to perform different types of tasks. polymorphism is extensively used in implementing inheritance. 10

7. Dynamic binding In dynamic binding, the code to be executed in response to function call is decided at runtime. C++ has virtual functions to support this. 11

Dynamic binding 12

8. Message Passing Objects communicate with one another by sending and receiving information to each other. A message for an object is a request for execution of a procedure and therefore will invoke a function in the receiving object that generates the desired results. Message passing involves specifying the name of the object, the name of the function and the information to be sent. 13

Benefits of OOP Benefits to the programmer 1. 2. 3 Benefits to the user 1. 2. 3. 14

Applications of OOP Applications of OOP are beginning to gain importance in many areas. The most popular application of object-oriented programming, up to now, has been in the area of user interface design such as window. Hundreds of windowing systems have been developed, using the OOP techniques. Real-business system are often much more complex and contain many more objects with complicated attributes and method. OOP is useful in these types of application because it can simplify a complex problem. The promising areas of application of OOP include: Real-time system simulation and modeling Object-oriented data bases Hypertext, Hypermedia, and expertext AI and expert systems Neural networks and parallel programming Decision support and office automation systems CIM/CAM/CAD systems 15

Quiz What is the difference between data encapsulation and data abstraction What are the benefits to the user by using object oriented programming approach 16

Practice problems Write a class to store details of students under following heads Name Roll no Marks (a) Calculate average marks of the class and (b) find topper of the class Write a program to calculate volume of a box using class. (a) Calculate volume in main function (b) Calculate volume in the class using member function definition within the class (c) Calculate volume in the class using volume function definition outside the class and outside the main function (d) Now increase the number of boxes by taking input from the user 17

Dr. Atul Dwivedi, BIT Durg, (India) email : atuldwivedi@live.in 8/23/2017 18