×
I find that the harder I work, the more luck I seem to have.
--Your friends at LectureNotes
Close

Previous Year Exam Questions of Object Oriented Programming Using Cpp of bput - OOP by Verified Writer

  • Object Oriented Programming Using Cpp - OOP
  • 2017
  • PYQ
  • Biju Patnaik University of Technology Rourkela Odisha - BPUT
  • Electronics and Communication Engineering
  • B.Tech
  • 7016 Views
  • 134 Offline Downloads
  • Uploaded 1 year ago
0 User(s)
Download PDFOrder Printed Copy

Share it with your friends

Leave your Comments

Text from page-1

Registration No: Total Number of Pages: 03 B.Tech. PET5J007 5th Semester Regular Examination 2017-18 Object Oriented Programming BRANCH: ECE,ETC Q.CODE : B462 Time: 3 Hours Max Marks: 100 Answer Question No.1 and 2 which are compulsory and any four from the rest. The figures in the right hand margin indicate marks. Q1 a) b) c) d) e) f) g) h) Answer the following questions: multiple type or dash fill up type Which of the following statements is correct? A. Base class pointer cannot point to derived class. B. Derived class pointer cannot point to base class. C. Pointer to derived class cannot be created. D. Pointer to base class cannot be created. Which of the following is correct about function overloading? A. The types of arguments are different. B. The order of argument is different. C. The number of argument is same. D. Both A and B What happens if the base and derived class contains definition of a function with same prototype? A. Compiler reports an error on compilation. B. Only base class function will get called irrespective of object. C. Only derived class function will get called irrespective of object. D. Base class object will call base class function and derived class object will call derived class function. Which of the following is a mechanism of static polymorphism? A. Operator overloading B. Function overloading C. Templates D. D. All of the above Which of the following statements regarding inline functions is correct? A. It speeds up execution. B. It slows down execution. C. It increases the code size. D. Both A and C. Which of the following is used to make an abstract class? A. Declaring it abstract using static keyword. B. Declaring it abstract using virtual keyword. C. Making at least one member function as virtual function. D. Making at least one member function as pure virtual function. Template class is also called as Generic class b) container class c)virtual class d) base class Which of the following is correct about the statements given below? I) All operators can be overloaded in C++. II) We can change the basic meaning of an operator in C++. A) Only I is true. B) Both I and II are false. C) Only II is true. D) Both I and II are true. (2 x 10)

Text from page-2

i) j) Q2 a) b) c) d) e) f) g) h) i) j) Generic catch handler is represented by ______________ a. catch( ..,) b. catch(---) c. catch(…) d. catch( void x) Throwing an unhandled exception causes standard library function _______________ to be invoked. a. stop() b. aborted() c. terminate() d. abandon() Answer the following questions: Short answer type Define data encapsulation and data abstraction with suitable example We know that a private member of a base class is not inheritable. Is there any way possible for objects of a derived class to access the private members of a base class. If yes how?. Remember the base class can’t be modified. Differentiate between Compile time polymorphism and run time polymorphism. Define this pointer. With suitable example mention the output of cout<<*this and cout<<this. What is static data member? Explain with a suitable example What is an exception and how it is different from an error? List the operator that can’t be overloaded in C++? Define namespace with a suitable example. Define Virtual Base class with example. Define generic catch block in C++. (2 x 10) Q3 a) b) Briefly explain object oriented programing features with respect to C++. Write a program in C++ to find the GCD of two numbers using class and function recursion. (10) (5) Q4 a) Write a program in C++ using class, object and friend function to check the given numbers are palindrome or not. The numbers are stored in an array data structure. If any elements in the give array is not palindrome then the program should print a palindrome number after converting the same element to palindrome number. Define constructor. Design a class room having data member height, width and length. Calculate the area and volume of the room. Use parameterised constructor for initialization. Use copy constructor for calculating are of 2 more similar rooms. (10) What is operator overloading? Write a program in C++ to add two complex number using operator overloading. Write a program to overload any unary operator. (10) b) Q5 a) b) (5) (5)

Text from page-3

Q6 a) b) Explain different types of inheritance with suitable C++ program. A class Student has name as its data member. Then three different classes Arts, Engg, Medical are derived from it respectively. These classes have university and college name as their data member. Finally there are three different classes CS, IT, MCA derived from Engg class. These classes have roll no as their data member. WAP to implement the above inheritance and display the contents of each individual objects of each class separately. (10) (5) Q7 a) Differentiate between abstract class and concrete class. Define binding w.r.t object oriented programming. Explain the use of VTABLES and VPTR with suitable example. What is virtual function? With suitable C++ program explain its use. (10) Differentiate between template class and class template. Write a program in C++ to reverse a given number using template based function. Write a program to accept 10 integers in an array. Check all numbers in the array. When any negative number is found, throw an exception (10) a) Write short answer on any TWO: a) Kind of Relationship Vs has a relationship b) Inline function c) Anonymous Object d) Exception handling in C++ (10) b) Write a program in C++ to display the frequency of a character in a string using class and object. (5) b) Q8 a) b) Q9 (5) (5)

Lecture Notes