VU Final Term Past Papers
90 solved final term past paper MCQs for CS304 (Object Oriented Programming) at Virtual University, each with the correct answer marked. Use them to learn the VU question style and test your recall. An independent study tool — not affiliated with VU.
Prefer a summary first? Read the CS304 final term handout.
Q1. Which of the following causes run time binding?
Q2. Considering the resolution order in which compiler search for functions in a program; the first priority is given to; the first priority is given to,
Q3. ThreeDimensionalShape would normally be concrete, while classes like Sphere and Cube would normally be abstract.
Q4. Which of the following is the best approach if it is required to have more than one functions having exactly same functionality and implemented on different data types?
Q5. A copy constructor is invoked when
Q6. A class template may inherit from another class template.
Q7. In Private -------------- only member functions and friend classes or functions of a derived class can convert pointer or reference of derived object to that of parent object
Q8. Which of the following is/are advantage[s] of generic programming?
Q9. Non Template Friend functions of a class are friends of ________instance/s of that class.
Q10. A pointer to a base class can point to objects of a derived class. \
Q11. A template argument is preceded by the keyword ________.
Q12. Which one of the following terms must relate to polymorphism?
Q13. Multiple inheritance can be of type
Q14. A function call is resolved at run-time in___________
Q15. Classes like TwoDimensionalShape and ThreeDimensionalShape would normally be concrete, while classes like Sphere and Cube would normally be abstract.
Q16. In order to define a class template, the first line of definition must be:
Q17. The user must define the operation of the copy constructor.
Q18. Compiler performs ________ type checking to diagnose type errors,
Q19. Vectors contain contiguous elements stored as a[an] ___.
Q20. ` 86. What is a class?
Q21. Inheritance is a way to
Q22. We can use "this" pointer in the constructor in the body and even in the initialization list of any class if we are careful,
Q23. ________ and ______ methods may not be declared abstract.
Q24. ------------- members are somewhere between public and private members. They are used in inheritance
Q25. Which of these are examples of error handling techniques ?
Q26. ----------------- follow try block to catch the object thrown
Q27. Graphical representation of the classes and objects is called object model it shows -------
Q28. Destructor can be overloaded
Q29. Which of the following is the best approach to implement generic algorithms with minimum number of coding lines?
Q30. Suppose we have two derived classes from a single class, can we write a method with same name in both these derived classes? Choose the best option.
Q31. Considering the resolution order in which Considering the resolution order in which compiler search for functions in a program; the first priority is given to; the first priority is given to,
Q32. In ________, a base class can be replaced by its derived class,
Q33. Which of the following operator(s) take(s) one or no argument if overloaded?
Q34. Which of the following operators can not be overloaded?
Q35. Which type of inheritance is being represented by the following statement, class X : public A, public B { ... ... };
Q36. When we write a class template the first line must be:
Q37. Function templates should be used where code and behavior must be identical.
Q38. The specialization pattern <T*> after the name says that this specialization is to be used for every,
Q39. Which of the following is an integral part of an object?
Q40. ___________, which means if A declares B as its friend it does NOT mean that A can access private data of B. It only means that B can access all data of A.
Q41. If a class D has been derived using protected inheritance from class B (If B is a protected base and D is derived class) then public and protected members of B -------- accessed by member functions and friends of class D and classes derived from D
Q42. The type that is used to declare a reference or pointer is called its ---------
Q43. The sub-object’s life is not dependant on the life of master class in __________.
Q44. Encapsulation means
Q45. Which of the following may not be an integral part of an object?
Q46. Public methods of base class can --------- be accessed in its derived class
Q47. When the base class and the derived class have a member function with the same name, you must be more specific which function you want to call (using ___________).
Q48. In case of multiple inheritance a derived class inherits,
Q49. ` 137. Which of the following is incorrect line regarding function template?
Q50. Fred* p = new Fred[10]; calls the default constructor 10 times 140. When a variable is define as static in a class then all object of this class,
Q51. Which of the following operators always takes no argument if overloaded?
Q52. When a subclass specifies an alternative definition for an attribute or method of its superclass, it is _______ the definition in the superclass.
Q53. The mechanism of selecting function at run time according to the nature of calling object is called,
Q54. Dynamic binding means that target function for a call is selected at run time Which one of the following functions returns the total number of elements in a vector.
Q55. Associativity can be changed in operator overloading.
Q56. Which operator can not be overloaded?
Q57. Suppose obj1 and obj2 are two objects of a user defined class A. An + operator is overloaded to add obj1 and obj2 using the function call obj1+obj2. Identify the correct function prototype against the given call?
Q58. `
Q59. No: 9 ( Marks: 1 ) - Please choose one Which of the following is/are advantage[s] of generic programming?
Q60. What is a class?
Q61. Default constructor is such constructor which either has no ---------or if it has some parameters these have -------- values
Q62. Like template functions, a class template may not handle all the types successfully.
Q63. Each try block can have ______ no. of catch blocks.
Q64. _______ “is a” relationship
Q65. (Object-Oriented Programming in C++)
Q66. Non Template Friend functions of a class are friends of ________instance/s of
Q67. The specialization pattern after the name says that this specialization is to be used for every,
Q68. Which sentence clearly defines an object?
Q69. What is true about function templates?
Q70. Consider a class named Vehicle, which of the following can be the instance of class Vehicle? 1. Car 2. Computer 3. Desk 4. Ahmed 5. Bicycle 6. Truck
Q71. The life of sub object is dependant on the life of master class in _____________.
Q72. Which one of the following functions returns the total number of elements in a vector.
Q73. The main function of scope resolution operator (::) is,
Q74. When a variable is define as static in a class then all object of this class,
Q75. Object Oriented Programming FROM FINALTERM PAPERS 14 Feb, 2011 CS304- Object Oriented Programming (Session - 3)
Q76. Object Oriented Programming (Session - 3)
Q77. (the function invocation is resolved at compile time)
Q78. The this pointer is a hidden pointer inside every class member function that points to the class object the member function is working with.
Q79. Object Oriented Programming (Session - 4)
Q80. Fred* p = new Fred[10]; calls the default constructor 10 times
Q81. Object Oriented Programming (Session - 1)
Q82. Which of the following operator overloading declaration can be used for pre-increment operators implemented as a member function of the class Complex?
Q83. A class that defines the cin and stream extraction operator is called:
Q84. While operator overloading, the binary operator is always called with reference to the ____________.
Q85. Following code is equivalent to which option: ```cpp class Shape { protected: string type; }; ```
Q86. Consider the following statement. What is the best statement about this line of code: `char & operator(int);`
Q87. Suppose c1, c2, and c3 are objects of the Complex class, and we overloaded the + operator. `c3 = c1 + c2;` In this statement, which object will be passed as an argument when the + operator is called?
Q88. Which one is the best description of polymorphism?
Q89. The subscript operator is overloaded as a member function of the class, and there will be only one parameter with ____________ data type.
Q90. Which of the following will be affected by overloading an operator?