Sei sulla pagina 1di 26

RAYAT & BAHRA INSTITUTE OF ENGG.

& NANO-TECHNOLOGY HOSHIARPUR

CS -252 OBJECT ORIENTED PROGRAMMING Internal Marks: 40 L T P External Marks: 60 310 Total Marks: 100 1. Basics of C & C++ Introduction, Basics, Data Type, Bit Field integer, Operations, Control Structures, Storage Classes, User Defined Data Type, Reserved Words and Standard I/O Statements in C & C++. 2. Object Orient Programming With C++ Introduction, Object Oriented Programming Concept, Objective of OPP, Programming Structure in C++, Data Abstraction 3. Overloading and Information Hiding Introduction, Function Overloading, Information Hiding 4. Memory Management in C++: Introduction, Constructor-Automatic Initialization of Objects, Dynamic Memory Management, Default Constructor, Copy Constructor, Constructor and Information Hiding, Destructor-Automatic Clear up of an Object 5. Inheritance Introduction, Inheritance-Data and Code Sharing, Class Derivation, Ambiguity in Class Member Access, Virtual Base Class-A Remedy, Class Initialization in Inheritance, Arguments for the Base Class 6. Bindings and Polymorphism Introduction, Bindings in C++, Polymorphism 7. Generic Facility Introduction, Concept of Generic Facility, Generic Function, Overloading a Generic Function, Generic Classes 8. File Handling in C++ Introduction, Concept of Stream in C++, File Positioning Functions, Error Handling During File Operation

R y t-B h In teo a a a ra stitu f E g e rin &N n -T c n lo y H sh rp r. n in e g a o e h o g , o ia u


LESSON PLAN (THEORY)
Name of the faculty Member: Er. Simarpreet Singh Course Title: OOPS Class: ECE II B Semester: 3rd Department: CSE/IT Course Code: CS-252 Session: August-December Batch: 2010-2013

SNo.

Topic/Subtopic

Lecturers Required 1 1 3 1 1 1 4 1 1 1 1 4 1 1 1 1 4 1 1

Syllabus to be covered before MST I (15Letures)


1. 2. 3. Brief introduction with students, introducing the scope of the subject and the approach to be taken to discuss and deliberate the subject matter, and introducing the evaluation plan. Quick review of the subject matter learned in their first year Concepts of Object-Oriented Programming: Basic of OOPS, Classes, objects and its attributes, some real life examples of objects, Roles of objects, operations on objects, abstraction, encapsulation and suitable examples Data hiding, inheritance, overloading, polymorphism, dynamic binding, messaging. 4. Console Input/Output Handling: Introdcuing the concept of streams, pre-defined streams, I/O handling using Insertion(<<) & extraction (>>) operators I/O using member functions of I/O streams getc(), putc(), getline(), write(). Formatting output using member functions and flags of ios class 5. Formatting output using manipulators, creating own manipulators. Classes & Objects: Defining a class, creating objects, accessing members of a class Defining member functions (inside as well as outside the class) Static members and their storage and handling 6. Passing objects as functions arguments, returning objects from functions. Constructors & Destructors: Introduction to constructor, special characteristics of constructors, need for constructors, declaration and definition of constructors Types of constructor default, zero argument, parameterized, dynamic constructor.

Syllabus to be covered before MST II (15Letures)


7. Constructors & Destructors contd.: Copy constructor, explicit constructor, overloading of constructors, initializer list. Introduction to destructor, special characteristics of destructors, need for destructors, declaration and definition of constructors Overloading and Type Conversion: Meaning of overloading and its benefits, Function Overloading. Rules for overloading, Overloading increment/ decrement operators. Overloading unary and binary operators, overloading relational operators. Overloading of memory management operators, overloading I/O stream operators. 9. Type conversions basic to class type, class type to basic type, class type to class type. Inheritance: Meaning of inheritance and its benefits, types of inheritances, role of access specifiers in inheritance. Overriding member functions, Ambiguities in multiple, hybrid type of inheritance and its handling. 1 0. Order of execution of constructors & destructors, few practical examples. Pointers: Introduction to pointers, accessing address of a variable, declaring and initializing pointers, dereferencing a pointer Pointer arithmetic, Memory allocation static & dynamic, heap/free store, introduction to dynamic memory management new and delete operators. Pointers as function arguments, pointers and arrays, pointers and structures. Pointer and classes, debugging pointers, Few practical examples to demonstrate the use of pointers. Polymorphism & Virtual Functions: Introduction to polymorphism, early v/s late binding, virtual functions, abstract classes. Pure virtual functions, virtual destructors and polymorphism. 1 1 4 1 1 1 1 3 1 1 1 4 1 1 1 1 2 1 1

8.

1 1.

Syllabus to be covered before MST III (07Letures)


1 2. Generic Programming: Concepts of generic facility and source code level reuse, generic functions. 1 3. Generic classes. Brief introduction to STL Exception Handling: Tradition error handling and its limitations, basics of exception handling, mechanism of exception handling, keywords used for exception handling facility. Throwing and catching exception, re-throwing exceptions, specifying exceptions. 1 4. Generic classes. Brief introduction to STL File Handling: Introduction to data files, justification for the use of data files, introduction to file streams, opening a file using constructors and open() member function. Reading/writing of sequential files, file pointers and their manipulation. Accessing files randomly, error handling during file operations. 2 1 1 2 1 1 3 1 1 1

Total Lectures - 36

Text Books & References: S. No 1. 2. 3. 4. 5. 6. Title of Book Object Oriented Programming with C++ A Complete Reference to C++ Language Object Oriented Programming with C++ The C++ Programming Language Programming With C++ (Schaum Series) Test Your Skills in ObjectOriented Programming With C++ Name of Author Robert Lafore R. S. Salaria E. Balaguruswamy Bjarne Stroustrup John R. Hubbard R. S. Salaria Salaria Publishing House Name of Publisher Pearson Salaria Publishing House Tata McGraw Hill Addison Wesley Tata McGraw Hill

Rayat Bahra Institute Of Engg. & Nano Technology Hoshiarpur CS -252 OBJECT ORIENTED PROGRAMMING ASSIGNMENT 1 Topic(s) Covered: BASICS OF C and C++, OPERATORS, Date of Allotment: Q1. (a) What do you understand by C++ Tokens? (b) What are Keywords ? (c) What are different data types in C++ ? (d) What are operators in C++ ? (e) What are constants? (h) What is the range and size of basic data types? (i) Differences between C and C++ Date of Submission:

Rayat Bahra Institute Of Engg. & Nano Technology Hoshiarpur CS -252 OBJECT ORIENTED PROGRAMMING ASSIGNMENT 2 Topic(s) Covered: CONTROL STRUCTURES: Date of Allotment: Date of Submission:

Q1. Explain: Conditional Statement(if, if-else, nester-if, switch) Q2. Explain: Loop Statements(for, while, do-while) Q3. Explain: Breaking Control Statements(break, continue, goto) Q4. Explain what inline functions are. Q5. Write a program to illustrate the function with no arguments but has a return value. Q6. What is friend function? Explain with the help of a program.

Rayat Bahra Institute Of Engg. & Nano Technology Hoshiarpur CS -252 OBJECT ORIENTED PROGRAMMING ASSIGNMENT 3 Topic(s) Covered: Concept of OOPs Date of Allotment: Date of Submission:

Q1.Explain the Objectives of OOP. Q2.Explain the terms:- Objects Classes Encapsulation Inheritance Reusability Polymorphism. Abstraction Q3. Difference between OOPs and procedure oriented language. Q4. Explain the basic skeleton structure of C++ with the help of example.

Rayat Bahra Institute Of Engg. & Nano Technology Hoshiarpur CS -252 OBJECT ORIENTED PROGRAMMING ASSIGNMENT 4 Topic(s) Covered: Constructors & Destructors, Operator Overloading,Pointers & Dynamic Memory Management Date of Allotment: Date of Submission:

Q1.What is role played by constructors and destructors? Give key special characteristics of constructors and destructors. Q2.Define the Terms: Default constructor Copy constructor Parameterized Constructor Q3. What is operator overloading? What benefit is derived using operator overloading. Q4. What is a pointer? What kind of operations can be performed on pointers? Q5. What is dynamic memory management? How this is done in C++? Q6. What is this pointer? What is special about this pointer

Rayat Bahra Institute Of Engg. & Nano Technology Hoshiarpur CS -252 OBJECT ORIENTED PROGRAMMING ASSIGNMENT 5 Topic(s) Covered: Inheritance,Access specifiers,virtual base classes and abstract class Date of Allotment: Date of Submission:

Q1. What is Inheritance? Explain its types and its usefulness. Q2. Define Access Specifiers. What is the difference b/w Private, Public, Protected derivation? Q3.What is the application of Scope Resolution operator in C++? Q4. Define Virtual Base Class. Q5. What is Abstract Classes?

Rayat Bahra Institute Of Engg. & Nano Technology Hoshiarpur CS -252 OBJECT ORIENTED PROGRAMMING ASSIGNMENT 6 Topic(s) covered :Polymorphism,Binding,Virtual Function,Friend Function Date of Allotment: Date of Submission:

Q1. What is polymorphism and how is it implemented in C++?Explain its types Q2. Explain the concept of Binding and also explain its types. Q3. Differentiate between early (static) and late (dynamic) binding. Q4. Define Virtual Function with the help of example. Q5. Difference between Virtual function and Pure Virtual Function. Q6. Define Friend Function. explain its advantages. Q7. Write a program using friend function.

Rayat Bahra Institute Of Engg. & Nano Technology Hoshiarpur CS -252 OBJECT ORIENTED PROGRAMMING ASSIGNMENT 7 Topic(s) Covered: Generic Facility Date of Allotment: Date of Submission

Q1.Define generic Pointers. Q2.Explain the concept of generic classes with the help of suitable Example. Q3.Define Generic Functions .Overloading of Generic Functions.

Rayat Bahra Institute Of Engg. & Nano Technology Hoshiarpur CS -252 OBJECT ORIENTED PROGRAMMING ASSIGNMENT- 8 Topic(s) Covered: File handling Date of Allotment: Date of Submission:

Q1. What are the different ways to open a file? Give example in each case. Q2.What is a file pointer? Q3.Explain various steps in processing a file. Q4.What are command line arguments? Q5. How is an error handled in a file in C++? Q6.What is an exception? Q7.What is Random Access File? How random access is done in files?

List of experiments:

1. WAP to find the largest out of four numbers. 2. WAP to find reverse of the input number. 3. WAP to generate the Fibonacci series till Nth term 4. WAP to find factorial of a number using recursive function 5. WAP to create a four function calculator (using switch case). 6. WAP to add, subtract and multiply two complex numbers using structure. 7. WAP to display contents of objects using operator overloading 8. WAP to implement multiple inheritance 9. WAP to read an array, sort that array and then print. 10. WAP to read two strings concatenates these two and print result. 11. WAP to implement matrix multiplication 12. WAP to swap two numbers using pointers 13. WAP to read data variables of a class by member function and display contents of class objects on screen. 14. WAP to generate Fibonacci series using constructor. 15. WAP to print the object number whenever we create an object. 16. WAP to concatenate two strings by operator overloading. 17. WAP to show the concept of function overloading. 18. WAP to write a set of lines from keyboard & to store it on a specified file. 19. WAP to access the private Data of a class by non-member function through a friend function. 20. WAP to illustrate the concept of generic facility.

RAYAT BAHRA INSTITUTE OF ENGINEERING & NANO-TECHNOLOGY , HOSHIARPUR

QUESTION BANK
UNIT-I FUNDAMENTALS PART-A (2MARKS) 1) What is Object Oriented Programming? 2) Write any four features of OOPS. 3) What are the Basic concepts of OOS? 4) What is Procedure oriented language? 5) Define objects. 6) Define class. 7) Give any four advantages of OOPS. 8) Give any four applications of OOPS. 9) Give any four applications of C++. 10) Define tokens. 11) What is keyword? 12) Rules for naming the identifiers in C++. 13) What is a scope resolution operator? 14) Rules for naming the identifiers in C++. 15) What are the operators available in C++? 16) What are free store operators (or) Memory management operators? 17) What do you mean by enumerated data type? 18) Define the term Standard Template Library (STL). 19) Explain in details about the concepts of OOPs? 20) Explain in detail about Programming Elements 21) Explain in detail about the following terms with example programs 22) (a)Function Invocation 23) (b)Function Prototypes 24) What is meant by Default arguments? Give example program 25) What do you mean by enumerated data type? 26) What are symbolic constants? 27) What do you mean by dynamic initialization of variables? 28) What are reference variable? 29) What is member-dereferencing operator? 30) What is function prototype? 31) What is an inline function? 32) Write some situations where inline expansion may not work. 33) What is a default argument? 34) What are the constant arguments? 35) What is call- by- reference? 36) Define Function Overloading? Explain the example program. 37) Explain in detail about Scope class 38) Explain in detail about Storage class with example program 39) Write short notes on Pointer Types 40) Explain in detail about 41) (a)Arrays and Pointers 42) (b)Standard Template Library (STL)

43) What is meant by data hiding? 44) Name at least two Oops languages other than C++. 45) What is Object oriented Paradigm? Explain the various Features of oops 46) Advantages of OOPS. 47) Merits &Demerits 48) Write about If. Else Statements and Switch Statement and DoWhile Statement. 49) Write about functions in C++ in detail.

PART-B (8 MARKS) 50) Explain with the Basic Concepts of object oriented programming. 51) Explain the elements of object oriented programming. (8) 52) What are the difference between reference variables and normal variables? Why cannot a constant value be initialized to variables of reference type? (8) 53) Explain about call-by-reference and pointer types with program. 54) Describe the advantages of OOP. (8) 55) What are the difference between pointers to constants and constant to pointers? (8) 56) Describe the applications of OOP technology. (8) 57) What is function invocation? Explain briefly with program. (8) 58) Explain the merits and demerits of object oriented methodology. (8) 59) Write notes on Standard Template Library. (8) UNIT-II Classes & Objects PART-A(2MARKS) 1) What is the use of copy constructor? 2) What is the need for having static members in a class? Give example. 3) What is the variable in C++? How to form a variable? 4) What is constructor? What is its role? 5) What is class? What are parts of class speciation? 6) Draw a stream class hierarchy. 7) Explain the declaration of a class in C++.How will you define the member function of a class? Explain 8) What is the need for parameterized constructor? Explain the function of constructors with their declaration inside a class 9) Explain all types of inheritance. 10) What is virtual function? Give an example to highlight its need? 11) What is a Friend function? Describe their benefits and limitations? Give suitable example. 12) What is meant by function overloading? Write the rules associated with function 13) overloading. Give suitable example to support your answer? 14) Explain virtual base classes and virtual function, pure virtual function. 15) Define the term Aggregate Type Struct. 16) What is structure Pointer Operator? 17) What is Union? 18) Define Bit Fields. 19) How the Class is specified? 20) How the member functions are defined?

21) Define constructor. 22) Define default constructor. 23) Define parameterized constructor. 24) What is the ambiguity between default constructor and default argument constructor? 25) Define copy constructor. 26) Define default argument constructor. 27) Define Destructor. 28) Write some special characteristics of constructor. 29) How the objects are initialized dynamically? 30) What is static data member? 31) What is static member function? 32) What is the use of this keyword? 33) Differ Explain in detail about Structure with syntax and write example program. 34) Define Union. Explain with example program. 35) Explain in detail about Bit -Field Structures. 36) Define Member Function and explain in detail about function inside 37) the class body with example program . 38) What is Parameterized constructor? Give syntax and example program 39) Define Member Function and explain in detail about function outside the class body 40) with example program. 41) (a)What is Default constructor? Give syntax and example program 42) What is Copy constructor? Give syntax and example program 43) Write short notes on 44) Static Member function 45) This Pointer 46) What is Destructor? Give syntax and example program 47) Write short notes on 48) Classes with necessary syntax and example program 49) Difference between Structure and Union.

UNIT-III IMPLEMENTING ADTs & ENCAPSULATION PART-A (2MARKS) 1) What is an encapsulation? 2) What is static data member? 3) What is static member function? 4) How the objects are used as function argument? 5) Define const member. 6) Define pointers to member. 7) Define constructor. 8) Define default constructor. 9) Define parameterized constructor. 10) Define default argument constructor. 11) What is the ambiguity between default constructor and default argument constructor? 12) Define copy constructor.

13) Define dynamic constructor. 14) Define const. object. 15) Define destructor. 16) Define multiple constructors. 17) Write some special characteristics of constructor. 18) How the objects are initialized dynamically? 19) Difference between structure and union. 20) Define Bit Fields PART-B (8 MARKS) 1) Explain copy constructor and destructor with suitable C++ coding. 2) Explain about structure pointer operator and unions with program. 3) Explain about Implementation of simple ADTs. 4) Explain about static member and this pointer with suitable code. 5) What is a Bit field? Explain briefly. 6) Explain about Data Handling and member function. UNIT-IV POLYMORPHISM PART-A (2MARKS) 1) What is polymorphism? What are its types? 2) What is operator overloading? 3) What is function overloading? Give an example. 4) List out the operators that cannot be overloaded. 5) What is the purpose of using operator function? Write its syntax. 6) Write at least four rules for Operator overloading. 7) How will you overload Unary & Binary operator using member functions? 8) How will you overload Unary and Binary operator using Friend functions? 9) How an overloaded operator can be invoked using member functions? 10) How an overloaded operator can be invoked using Friend functions? 11) List out the operators that cannot be overloaded using Friend function. 12) What is meant by casting operator and write the general form of overloaded casting operator? 13) What is overloaded function selection algorithm? 14) What is meant by pointer operators? 15) Define ADTs.

PART-B (8 MARKS) 1) Explain about Unary Operator and Binary Operator Overloading with program. 2) Define the polymorphism. Explain the different types of polymorphism. 3) List out the rules for overloading operators with example. 4) Write Notes on ADT Conversions. 5) Explain about Function selection with program. 6) Explain about pointer operator with program. UNIT-V INHERITANCE PART-A (2MARKS)

1) Define basic to class type conversion with an example. 2) Define class to basic type conversion with an example. 3) Define one class to another class conversion with an example. 4) What is meant by inheritance? 5) What is meant by single inheritance? 6) What is multiple inheritances? 7) What is hierarchical inheritance? 8) What is multilevel inheritance? 9) What is hybrid inheritance? 10) What is meant by Abstract base class? 11) Write short notes on virtual base class. 12) What are Friend functions? Write the syntax 13) Write some properties of friend functions. 13) What are the virtual functions? 14) Write some of the basic rules for virtual functions 15) What are pure virtual functions? Write the syntax. 16) What is an Exception? 17) Give any rules for Virtual Functions. 18) What is Visibility mode? PART-B (8 MARKS) 1) What are the virtual functions? Explain their needs using a suitable example. What are the rules associated with virtual functions? 2) What are the different forms of inheritance supported in C++? Discuss on the visibility of base class members in privately and publicly inherited classes. 3) What are abstract classes? Give an example (with the program) to illustrate the use of abstract classes. 4) (a) Explain about Code Reuse with program. (b) Discuss about Run Time Type Identifications. 5) Write notes on Typing conversions and derived class with program. 6) Explain about Exceptions Handlers and Standard Exceptions. UNIT-VI TEMPLATES & FILE HANDLING PART-A (2MARKS ) 1) Define Streams. 2) What are the input and output streams? 3) Classify the streams. 4) Difference between get(),put (). 5) How to open and close a file? 6) Write some file opening modes. 7) What is a file pointer? 8) What is command-line argument? 9) What is an error and error handling functions? 10) How will you create manipulators? 11) Write the syntax and use of getline () and write () functions. 12) Give two types of template. 13) Define try and catch. 14) Define Exception handling.

15) Define File modes. 16) Give the general syntax for throw. PART-B (8 MARKS) 1) Explain about Template and its types with example. 2) Discuss about Streams and stream classes 3) Write notes on Formatted and Unformatted Console I/O Operations. 4) Explain about File Pointers and Manipulations with example. 5) Discuss about manipulators and file streams with Program. 6) Write on Details about File modes and File I/O. 7) Details for Exception Handling with Program.

TUTORIAL 1 1. What are compile time and runtime errors? 2. Name at least two Oops languages other than C++. 3. List out any two drawbacks of Procedure oriented languages. 4. Differentiate Object oriented and Object based Programming languages. 5. What is the role of switch statement in C++? 6. What is the main function of cout and cin? 7. Write a program to explain different types of arithmetic operators. 8. Write a program to find out largest among four numbers. 9. Briefly explain the use of break with switch statement in C++? 10. Relate object and class in OOP

TUTORIAL 2 1. Write a program to print the following output using For loop * ** *** .. 2. Write a program to swap two numbers using 1. third variable 2. without third variable How are prefix and postfix versions of operator++() differentiate? WAP to compute average of N real numbers. Write a program to check whether a number is Armstrong or not. Write a program to count the number of alphabets in a string. What is the difference between = and ==? Distinguish between the different types of loops with example. Why do we need the preprocessor directive #include<iostream>? Describe the unique advantages of an object oriented programming paradigm. What is recursion? Write a recursive program to find division of two integers? WAP a program to print table of 2. Write a program to implement the following output: * ** *** 14. Write a program to implement matrix multiplication and addition.

3.

4.

5.

6.

7.

8.

9.

10.

11.

12.

13.

TUTORIAL 3 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. Write a program to implement an array Write a program to implement 2D array Write a program to implement an array within a structure. Explain the term inline function. Define structures. Write a program to find out the biggest element in an array. Write a program to sort elements in an array. Write a program to implement a structure containing an information student. What is the difference between Array and Structure? How private and public members make a difference? How does a main() function in C++ differ from main in c? Write a program to find out the roots of a quadratic equation? What is the main advantage of passing an argument by reference? Write a program to implement addition of two complex numbers.

TUTORIAL 4 1. Distinguish between the following terms: Objects and classes Data abstraction and data encapsulation Inheritance and polymorphism Dynamic binding and message passing Inside the main program Inside the member function of the same class Inside the member function of the other class

2. Describe the mechanism accessing data members and member functions in the following cases:

3. What do you mean by inheritance in C++? 4. Describe the different forms of inheritance? Give example of each. 5. Describe the syntax of single inheritance in C++. 6. Write a program to implement hybrid inheritance. 7. When does an ambiguity occur in multiple inheritances? How can this ambiguity be resolved.

TUTORIAL 5 1. Explain the concept of classes in C++. 2. What are access modifiers? Explain 3. Explain the concept of call by value and call by reference with the help of program. 4. How object of a Class are created? 5. Can we initialize a data member in class template? If not why? 6. Explain polymorphism in C++. 7. Differentiate between polymorphism at run time and compile time. 8. Why do we need virtual functions? 9. What are pure virtual functions? 10. Explain the following terms with suitable examples: virtual base class Abstract class

Potrebbero piacerti anche