Sie sind auf Seite 1von 20

OBJECT ORIENTED PROGRAMMING AND GRAPHICS LABORATORY (OOPCG)

Examination Scheme Practical: 50 marks Term Work: 50 marks

Syllabus
UNIT-I: Introduction to Object Oriented Programming UNIT-II: Programming with C++ UNIT-III: Classes and Objects UNIT-IV: Operator Overloading UNIT-V: Inheritance and Polymorphism UNIT-VI: Templates UNIT-VII: Exception Handling UNIT-VIII: Files and Streams

ext Books:

. Balaguruswamy, Object Oriented Programming with C++, Tata


cGraw-Hill Publishing Company Ltd, New Delhi ISBN 0 07 Reference 462038 X.Books: R. Lafore, The Waite Groups Object oriented Programming in C++, 3rd Edition, Galgotia Publications, 2001, ISBN 81-7515-269-9.

nowledge of C Language

eys of OOP What is OOP? OOP is a design philosophy. It stands for Object Oriented Programming. Object-Oriented Programming (OOP) uses a different set of programming languages than old procedural programming languages (C, Pascal, etc.).

eys of OOP What is Procedural Programming Languages/Procedure oriented Programming (POP) ?


Conventional programming, using high level languages. Sequence of things. Number of functions.

Technique of hierarchical decomposition has been used to specify the tasks to be completed for solving the problem

eys of OOP What is Procedural Programming Languages/Procedure oriented Programming (POP) ? Concentration on the development of function. What about data?

Data items are placed global. Global data are vulnerable to an inadvertent change by a function.

eys of OOP Drawbacks of Procedural Programming Languages/Procedure oriented Programming (POP) Large program , difficult to identify what data is used by what function. Revise an external data structure, revise all functions that access the data, bugs to creep in. Doesn't model real life problems very well. Functions are action-oriented and do not really corresponds to the elements of the problem.

eys of OOP

eys of Oriented Paradigm Object OOP Motivating factor is to remove the flaws in the POP. OOP treats data as the critical element in the program development , does not allow to flow freely around the system. Decomposition of the problem into a number of entities called objects and then built data and function around these object.

eys of OOP

eys of OO Programming anguages that are based on classes are know as ObjectOriented. Eiffel C++ Modula-3 Ada 95 Java

Object Oriented Programming as an approach that provides a way of modularizing programs by creating partitioned memory area for both data and function that can be used as template for creating copies of such modules on demand

asics of OOP
oncepts used extensively in OOP Objects Classes Data abstraction and encapsulation Inheritance Polymorphism Dynamic binding Message passing

asics of OOP Objects


Objects are the basic run-time entities in an object-oriented system. Used to represent any data item that the program has to handle. Object take up space in the memory and have a associated address like a record in Pascal or a structure in C. When a program is executed the object interact by sending msg to one another. Each object contain data , and code to manipulate the data. Object can interact without having to know details of each others data or code.

asics of OOP Classes


Entire set of data and code of an object can be made a user-defined data types with the help of a class. Object are variable of the type class. Any number of objects can be created of that class. Classes are user-defined data types and behave like the built-in types of a programming language. Class is thus a collection of objects of similar type. For example: mango, apple, banana and orange are members of the class fruit. Syntax used: Fruit mango;

asics of OOP Data Abstraction and Encapsulation


The wrapping up of data and function into a single unit (called class) is known as encapsulation. Is the most striking feature of a class. The data is not accessible to outside world, and only those function which are wrapped in the class can access it. This insulation of the data from direct access by the program is called as data hiding or information hiding. Data abstraction refers to, providing only essential information to the outside word and hiding their background details ie. to represent the needed information in program without presenting the details. Data abstraction is a programming (and design) technique that relies on the separation of interface and implementation.

asics of OOP 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.

The principle behind this sort of division is that each derived class shares common characteristics with the class from which it is derived. Provides an opportunity to reuse the code functionality and fast implementation time. When creating a class, instead of writing completely new data members and member functions, the programmer can designate that the new class should inherit the members of an existing class.

asics of OOP Polymorphism


Greek term, means the ability to take more than one form. An operation may exhibit different behaviours in different instances Behaviour depends upon the types of data used in operations. The process of making an operator to exhibit different behaviours in different instances is known as operator overloading Polymorphism is extensively used in implementing inheritance.

What is OOP? OOP is a design philosophy. It stands for Object Oriented Programming. Object-Oriented Programming (OOP) uses a different set of programming languages than old procedural programming languages (C, Pascal, etc.). Everything in OOP is grouped as self sustainable "objects". Hence, you gain re-usability by means of four main object-oriented programming concepts. In order to clearly understand the object orientation, lets take your hand as an example. The hand is a class. Your body has two objects of type hand, named left hand and right hand. Their main functions are controlled/ managed by a set of electrical signals sent through your shoulders (through an interface). So the shoulder is an interface which your body uses to interact with your hands. The hand is a well architected class. The hand is being re-used to create the left hand and the right hand by slightly changing the properties of it.

Das könnte Ihnen auch gefallen