M.C.A DEGREE EXAMINATION,NOVEMBER/DECEMBER 2010 MC 9222-OBJECT ORIENTED PROGRAMMING (Regulation 2009) Max:100 Marks 1. How are data and function organized in an object oriented programming? 2. Compare private and public access specifiers in a class? 3. Write a program for swapping of two variables without using third variable. 4. What is the purpose of reference semantic? 5. What is a friend function? How friend functions are differ in inheritance? 6. List the operations cannot used in overloading. 7. What is an iterator? What are its characteristics? 8. What is STL? How is it different from the C++ Standard Library? 9. How is the type casting performed in C++? 10. What is an exception? When should a program throw an exception? 11.(a) What is Object iented Programming? How it differs from structured Programming? Discuss the characteristics of Object iented Languages. (2+6+8) (b) Explain the declaration of a class in c++. How will you define the member function of a class? Explain with an example. (16) 12.(a) What is the need for parameterized constructor? Explain the functions of default constructor, parameterized constructor and copy constructor declaration inside a class with suitable example. (4+12) (b) Write a c++ program for Stack ADT. (16) 13.(a)Explain the operator overloading of Binary Operators in c++ with suitable example. (16) (b)(i) What is meant by function overloading? Write the rules associated with function overloading. Give suitable example to support your answer. (8) (ii)what is this pointer? When is it used? Explain its use using an appropriate example. (2+2+4) 14.(a)Use templates to write a generic version of the bubble sort, complete with assertions and also 1 CCET
use a random number generator to generate test data. (16) (b) Explain the four different categories of STL algorithms with suitable example. (16) 15.(a)What are virtual functions? What are pure virtual functions? Discusswith the help of an example.(16) (b)what are the exceptions handled in c++? Explain with the help of an example. (6+10) M.C.A DEGREE EXAMINATION,NOVEMBER/DECEMBER 2010 CA 5152-OBJECT ORIENTED PROGRAMMING Max:100 Marks 1. Compare error and exception. Give an example. 2. Outline the use of ifdef and ifndef. 3. What is OOP? List out its characteristics. 4. Brief about dynamic memory allocation operator. 5. What are the C++ operators that cannot be overloaded? 6. When you overload member function in what ways must they differ? 7. Define pure virtual function. How will you declare it? 8. What is a generic function? How will you create a generic function? 9. What do you mean by interface? What are its significances? 10. List out the I/O object streams. 11.(a) (i) Define data abstraction. Write down its significance. Design a class circle. Identify its attributes and methods. [6] (ii) What are the features of virtual fuction? Describe its usage with syntax. [5] (iii) Generic programming is the basic requirement for the software development in industries. Justify. [5] (b)(i) Discuss with an example the usage of union and struct in C. [5] (ii) What are the difficulties encountered in monolithic type of application? Explain. [5] 2 CCET
(iii) How does OOP differ from procedure oriented programming? Discuss? [7] 12.(a) )(i) Compare class and object. Discuss the allocation of memory for class and object [8] (ii) What is the role of using the term static for members of the class and for the class itself. [8] (b) )(i) Consider two classes Employee, Manager with id and basic pay as data members and input and output member functions to get details and display tax. Write a friend function income tax to operate on the objects of both these classes to calculate tax. [12] (ii) Write a inline function to find square of a number. [4] 13.(a) )(i) Write a program to overload + operator to add two Matrix objects and store results in another object. [10] (ii) Describe the usage of copy constructor with an example. [6] (b) Design a class Complex No. Using Operator Overloading wrire the routines to implement the operations add, sub, mul and div. [16] 14.(a)Write a program that accepts n numbers from the user and store it in a file named file 1. Read the contents of file 1 and check whether the number is prime or not. If prime store it in file2 otherwise in file3. [16] (b) (i) Write a detail exception handling in c++ with suitable example. [8] (ii) Design a class List and enumerate its member functions with the implementation of any three of them. [8] 15.(a) Design a class named Filter that reads an input text stream and find vowel letters and store them on an output text stream [16] (b) [i] Compare concrete types and abstract types. [10] (ii) Write short notes on Node classes. [6] 3 CCET
M.C.A DEGREE EXAMINATION, JUNE 2 MC9222-OBJECT ORIENTED PROGRAMMIN (Regulation 2009) Maximum:100 Marks 1. What is encapsulation? 2. What are the features required for an object oriented language? 3. Define parameterized constructor. 4. What is the use of this keyword? 5. List out the operators that cannot be overloaded. 6. Define polymorphism. 7. Define function template with its syntax. 8. What are synchronous and asynchronous exceptions? 9. What are pure virtual functions? Write the syntax. 10. What is hybrid inheritance? Give an example. 11. A) Explain the concepts of call by value and call by reference with suitable sample code. B) Explain the following concepts with suitable code. i) Function pointer ii) Array of Pointers 12. A) How will you classify functions in C++? Explain B)Explain the different types of constructor with sample code. 13. (A)How will you overload unary and binary operators using friend functions? Explain with sample code. B) (i) List out the operators that cannot be overloaded using friend function. (ii) What is meant by casting operator? Write the general form of overloaded casting operator. (iii) Write at least four rules for operator overloading. 14. (A)Write a C++ program to sort integer array element using Templates. (B) Explain the components of Standard Template Library. 15. (A) Explain the types of inheritance with sample code. (B) Define exception handling with its advantages and explain the same with sample code. 4 CCET
Question Bank UNIT-1 1. What is Object iented Programming? How it differs from structured Programming? Discuss the characteristics of Object iented Languages. 2. Explain the declaration of a class in c++. How will you define the member function of a class? Explain with an example. 3. Explain the concepts of call by value and call by reference with suitable sample code. 4. Explain the following concepts with suitable code. i) Function pointer ii) Array of Pointers UNIT-2 5. How will you classify functions in C++? Explain. 6. Explain the different types of constructor with sample code. 7. Write a c++ program for Stack and Queue ADT. 8. i) Consider two classes Employee, Manager with id and basic pay as data members and input and output member functions to get details and display tax. Write a friend function income tax to operate on the objects of both these classes to calculate tax. (ii) Write a inline function to find square of a number UNIT-3 9. Explain the operator overloading of Binary & unary Operators in c++ with suitable example 10. (i) What is meant by function overloading? Write the rules associated with function overloading. Give suitable example to support your answer. (ii)what is this pointer? When is it used? Explain its use using an appropriate example. 11. (i) Write a program to overload + operator to add two Matrix objects and store results in another object. (ii) Describe the usage of copy constructor with an example. 12. How will you overload unary and binary operators using friend functions? Explain with sample code. UNIT-4 13. Write a C++ program to sort integer array element using Templates. 14. Explain the components of Standard Template Library. 15. Use templates to write a generic version of the bubble sort, complete with assertions and also use a random number generator to generate test data. 16. Explain the four different categories of STL algorithms with suitable example. 17. Explain the following concepts with example. i) Function Template ii) Class Template 18. What are virtual functions? What are pure virtual functions? Discuss with the help of an UNIT-5 example. 19. Explain the types of inheritance with sample code. 20. Define exception handling with its advantages and explain the same with sample code. 5 CCET