CSIR Net GATE IIT JAM TIFR JEST NotesFull description
GIS notesFull description
Full description
compiled class 2 oral notesFull description
Full description
Deskripsi lengkap
in detailsFull description
A summary of the novel; 'I Know Why The Caged Bird Sings' by Maya AngelouFull description
data structures notes
A320 Class Notes
Full description
Full description
sqewqFull description
Compilation of Kannada Lessons for beginners
Chemistry Notes for Hydrogen
Class notes of mechanical engineering vibrations.
Description complète
Basics of Risk and Risk Management tools (A practical Approach)
class 10 historyFull description
x
SATHYABAMA UNIVERSITY DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING 6C0094 – PROGRAMMING IN C++ SYLLABUS UNIT – I Introduction to fundamental Concepts : Object oriented fundamentals, Structured verses Object oriented development, elements of object oriented programming, fundamentals of OOP - class, object, and abstraction and its importance, encapsulation, polymorphism, benefits of OOP, structure of C++ program. UNIT – II Classes and Objects: Working with classes - classes and objects - class specification, class objects, accessing class members, defining member functions, inline functions, accessing member functions within class, data hiding, class member accessibility, empty classes, constructors, parameterized constructors, constructor overloading, copy constructors, new, delete operators, “this” pointer, friend classes and friend functions. UNIT – III Overloading: Function overloading, operator overloading, overload able operators, unary operator overloading, operator keyword, limitations of increment/ decrement operators, binary operator overloading, arithmetic operators, function templates, class templates. UNIT – IV Inheritance: Base class and derived class relationship, derived class declaration, forms of inheritance, inheritance and member accessibility, constructors in derived class, destructors in derived class, multiple inheritance, multi level inheritance, hybrid inheritance, virtual base classes, virtual functions. UNIT – V Exception handling and files: Files and streams, opening and closing of files, file modes, file pointers and manipulation, sequential access to a file, binary file, random access to a file, error handling during file manipulation, exception handling, exception handling model, exception handling constructs, list of exceptions, catching exceptions, handling exceptions.
1
REFERENCE BOOKS: 1. K.R. Venu Gopal, T. Ravishankar, and Raj kumar, “Mastering C++”, Tata McGraw Hill, 1997. 2. E. Balaguruswamy, “Object Oriented Programming with C++”, Tata McGraw Hill, 2nd Edition, 2004. 3. Bjarne Stroustrup, “The C++ programming language”, Addison Wesley, 3rd Edition, 1998. 4. John R Hubbard, Programming with C++, 2nd edition Shaums Outline Series, McGraw Hill 5. James Martin & james J.Odell, Object Oriented methods – A foundation, Prentice Hall, 1997 6. Grady Booch, Object Oriented Analysis and Design with application, II Edition Addision Wesley, 1994
2
UNIT – I
(2 MARKS)
1. Characteristics of procedure oriented programming (c) Emphasis is on doing things (algorithms) Larger programs are divided into smaller programs known functions. Most of the functions share global data. Data move openly around the system from function to functions Functions transforms data from one form to another Employs TOP-DOWN approach in program design. 2. Characteristics of object oriented programming (c++) Emphasis is on data rather than procedure. Programs are divided into what known as OBJECTS Data structures are designed such that they characterize the objects Functions that operate on the data of an object are tied together in the data structure. Data is hidden and cannot be accessed by external functions. Objects may communicate with each other through functions New data and functions can be easily added whenever necessary Follows BOTTOM-UP approach in program design 3. What are difference between c and c++? S.No 1.
Procedure oriented Programming (C) Object Oriented Programming (C++) Programs are divided into smaller Programs are divides into objects & sub-programs known as functions classes
2.
Here global data is shared by most of Objects are easily communicated with the functions each other through function.
3.
It is a Top-Down Approach
4.
Data cannot be secured and available Data can be secured and can be to all the function available in the class in which it is declared
5.
Here, the reusability is not possible, Here, we can reuse the existing one hence redundant code cannot be using the Inheritance concept avoided.
3
It is a Bottom-Up Approach
4. Define encapsulation: It is the mechanism that associates the code and data it manipulates into a single unit and keeps them safe from external interference and misuse. In C++, this is supported by the construct called CLASS 5. Define inheritance : It allows the extension and reuse of existing code without having to rewrite the code from scratch. Inheritance involves the creation of new classes from the existing ones. The new derived class inherits the members of the base-class and also adds its own. Popular forms : 1. Single Inheritance 2. Multiple Inheritance 6. Define polymorphism: One name multiple forms A property by which we can send the same message to objects of several different classes, and each object can respond in a different way depending on its class. In C++ polymorphism is implemented by means of function overloading and operator overloading and by means of virtual functions. 7. Define classes: A group of objects that share common properties and relationships. In C++, class is a new datatype that contains member variables and member functions that operate on the variables. 8. Define object: Objects are basic runtime entities in an object oriented system. They may represent a person, a plea, a bank account etc. An instance of the calss is known as object. 9.Define message passing: It is the process of invoking an operation on an object. In response to the message, the corresponding method is executed in the object. 10.Define data abstraction: Abstraction refers to the act of representing essential features without including background details or explanations.The technique of creating new data types that are well suited to an application to be programmed is known as data abstraction. 4
1. Write a c++ program to read 2 numbers from the keyboard and display large value on the screen #include void main() { int a,b; cin>>a>>b; if(a>b) cout<
for accessing datamember of a class