Sunteți pe pagina 1din 22

Object Oriented Programming in C++

Instructor: Ms. Monika Kumari CSE (A + B) IV semester

Preamble
Course Syllabus Reference Text Book Evaluation Process Introduction Utility and Its Application Conclusion

Course Syllabus
UNIT I : Object oriented paradigm UNIT II : Classes and objects UNIT III : Inheritance UNIT IV : Virtual functions UNIT V : Exception handling

Unit I
Object oriented paradigm : Evolution of programming paradigm, structured versus object-oriented development, elements of object-oriented programming, objects, classes . Introduction to C++ : Introduction, hello world, streams based I/O, single line comment, literals constant qualifiers, scope resolution operator (::), variable definition at the point of use, variable aliases-reference variables, strict type checking, parameters passing by reference, inline function, function overloading, default arguments, keyword typedef, functions as part of struct, type conversion, function templates, runtime memory management.

Unit II
Classes and objects:
Introduction, class specification, class objects, accessing class members, defining member functions, outside member functions as inline, accessing member functions within a class, data hiding, access boundary of objects revisited, empty classes, pointers within a class, passing objects as arguments, returning objects from functions, friend functions and friend classes, constant parameters and member functions, structures and classes, static data and member functions, class, objects and memory resource, class design steps. Operator overloading: Introduction, over loadable operators, unary operator overloading, operator keyword, operator return values, nameless temporary objects, limitations of increment/decrement operators, binary operator overloading, arithmetic operators, concatenation of strings, comparison operators, arithmetic assignment operators, overloading of new and delete operators, data conversion, conversion between basic data types, conversion between objects and basic types, conversion between objects of different classes, subscript operator overloading, overloading with friend functions, assignment operator overloading, tracing memory links.

Unit III
Inheritance: Introduction, class revised, derived class declaration, forms of inheritance, inheritance and member accessibility, constructors in derived classes, destructors in derived classes, constructors invocation and data members initialization, overloaded member functions, abstract classes, multilevel inheritance, multiple inheritance, hierarchical inheritance, multipath inheritance and virtual base classes, hybrid inheritance.

Unit IV
Virtual functions: Introduction, need for virtual functions, pointer to derived class objects, definition of virtual functions, array of pointers to base class objects, pure virtual functions, abstract classes, virtual destructors.

Unit V
Exception handling: Introduction, error handling, exception handling model, exception handling constructs, handler throwing the same exception again, list of exceptions, catch all exceptions, exceptions in constructors and destructors, handling uncaught exceptions, exceptions in operator overloaded functions, exception in inheritance tree, exceptions in class templates, fault tolerant design techniques, case-study on software fault tolerance, memory allocation failure exception.

Reference Book
Books: Budd,Object Oriented Programming , Addison Wesley. Mastering C++ K.R Venugopal Rajkumar, TMH. Computer Science (a Structured approach using C++), B.A. Forouzan & R.F. Gillberg, CENGAGE Learning. C++ Primer, Lip man and Lajole, Addison Wesley. Balagurusami, Object oriented with C++, TMH.

Evaluation Process
Class Assessment 40% Mid Term 20% End Term 40% Your All Study materials be posted after each lecture at our Yahoo Group Group name: OOPs_Csharda15 Group home page: http://in.groups.yahoo.com/group/OOPs_Csharda15 Group email: OOPs_Csharda15@yahoogroups.co.in

Instructor
Name: Ms. Monika Kumari Assistant Professor, CSE Deptt Office: 4th cabin on 5th floor, SDS Building Sharda University. Email: monika.kumari@sharda.ac.in Meeting hour: 12:00 2:30 pm Teaching Assitant: Ms. Palvi Gupta Office: 5th Floor, SDS Building, Sharda University

LABs & Tutorials


For lab and tutorial CS A and CS B are divided into groups. CS A have two groups : lab in 314 [G1,1/2G2]-> 090101001 to 090101060 [1/2G2, G3]->090101061 to 090101121 CS B have also two groups :lab in 321 [G1] -> 090101801 to 090101155[Monika Kumari] [G2] -> 090101156 to 090101198[Palvi Gupta]

Introduction

Programming Techniques
Unstructured or Monolithic programming Procedural programming Modular programming Object oriented programming

Monolithic Programming
Program consists of global data and statement which modify the data and finally it contains the output statements. Such programs are lengthy , Difficult to debug and difficult to maintain. //Main program Data Statement 1 Statement 2 Statement --------------Statement 1 Statement 2 end

Procedural Programming
// main program Global data Group of statements that carry out Statement similar action at several places in the Statement program such a group is taken out the main program and is placed in a subprogram called subroutine or Statement procedure or function Statement A procedural program is more structured Statement . Statement The different procedure or subroutine . can be checked independently of the main program , thus debugging become Statement easier Statement Also easier to maintain the program The drawback is that if the subroutine is Statement small and is called many times in the . program , the overload of calling makes Statement the program inefficient. end Procedure 1 or Subroutine Statement Statement .

Procedure 2 Statement Statement

Modular Programming
In this type of programming the similar procedure are grouped together into modules. Thus the whole program may consist of modules and connecting statements. The main program supplies data and co- ordinates the different modules . // main program Data Statements Statements -------------Statements Statements
Module 2

Module 1

Continued
Data DataM1 Statements Statements
Module 2 Data DataM2 Statements Statements Statements Statements Procedure 2 Module 1

Procedure 1

Procedure 3

Object Oriented Programming


The important factor of this technique is Data Abstraction. Different procedures and functions are built around the abstract data Thus the data and functions are encapsulated in a single structure called Class. In class different functions are defined according to the data that an object of the class must have.

Class Structure
Object Data Function1 Function2

Next class
Why do we need Object Oriented Programming? Procedural vs Object Oriented Programming Features of OOPs

THANKS..

S-ar putea să vă placă și