- Type
- Final term past paper
- Course
- CS304 Object Oriented Programming
- Size
- PDF 602 KB
- Updated
- 23 Oct 2026
You get 3 free files a day on the website. Add the Chrome extensionSign in with the extension for 30 a day.
Preview text
Text from pages 2, 3, 4 of 31. Download the file for all 31 pages.
CS304 FINALTERM LATEST QUIZ SPRING 2026
Lecture 19: Stream Insertion & Extraction Operators
- Which operator is used for stream insertion in C++? A) >> B) << C) <- D) ->
Correct option: B
- Which operator is used for stream extraction? A) << B) >> C) != D) ==
Correct option: B
- The object cout is an instance of which class? A) istream B) ostream C) iostream D) fstream
Correct option: B
Q4. The object cin is an instance of which class? A) ostream B) istream C) ifstream
Correct option: B
- Why are stream insertion/extraction operators usually overloaded as friend functions? A) They must be private B) The left operand is not an object of the class C) They are too large to be member functions D) They cannot return references
Correct option: B
- What is the return type of an overloaded stream insertion operator for chaining? A) void B) int C) ostream & D) istream &
Correct option: C
- Where is the default output stream? A) File B) Network socket C) Console D) Printer
Correct option: C
- Overloading stream operators allows us to treat user-defined types like: A) Functions B) Built-in types C) Constants D) Pointers
Correct option: B
Lecture 20: Subscript, Function, & Unary Operators
- Which operator is the subscript operator? A) () B) [] C) {} D) .
Correct option: B 10. The subscript operator [] must be overloaded as: A) A friend function B) A static function C) A member function D) A global function
Correct option: C 11. Which operator is used to perform sub-string operations in some class designs? A) [] B) () C) -> D) *
Correct option: B 12. Unary operators operate on how many operands? A) Zero B) One C) Two D) Three
Correct option: B 13. Which of the following is a unary operator? A) + B) - (negation) C) * (multiplication) D) /
Correct option: B 14. When overloading a unary operator as a member function, how many arguments does it take? A) 0 B) 1 C) 2 D) None of these
Correct option: A 15. When overloading a unary operator as a friend function, how many arguments does it take? A) 0 B) 1 C) 2 D) 3
Correct option: B 16. Which of these operators cannot be overloaded? A) + B) :: C) [] D) ()
Correct option: B
Lecture 21: Increment/Decrement & Type Conversion
17. How does the compiler distinguish between prefix and postfix ++? A) Different return types B) A dummy int argument in postfix C) Using the virtual keyword D) Using different names
Correct option: B 18. What is the syntax for the prefix increment operator as a member function? A) operator++() B) operator++(int) C) ++operator() D) operator(int)++
Correct option: A 19. The prefix increment operator typically returns: A) A copy of the old value B) A reference to the updated object C) A constant integer D) Nothing
Correct option: B 20. The postfix increment operator typically returns: A) A reference to the object B) A copy of the object before incrementing C) A null pointer D) A boolean value
Correct option: B 21. Type conversion operators are used to: A) Change variable names B) Convert user-defined types to other types C) Delete objects D) Create new classes
Correct option: B 22. A type conversion operator has: A) Many arguments B) No return type specified in syntax C) A void return type D) A static keyword
Correct option: B
Related CS304 files
All CS304 files →- CS304 Final Term Quizzes July 2023 by Sana Sheikh Final term PDF 590 KB
- CS304 Final Term Current Paper 2020 by VUBuddy Final term PDF 544 KB
- CS304 Final Term Current Papers 2018-2020 Final term PDF 38 KB
- CS304 Final Term Past Paper Spring 2010 Final term ZIP 15 KB
- CS304 Official Handouts Official handout PDF 2.8 MB Free
- CS304 Solved Quiz by Riz Mughal Quiz PDF 2.1 MB
Get more out of VUBuddy, for free
- Unlimited downloads
- The explanation behind every MCQ answer
- Study offline on slow data
- 30 downloads a day instead of 3
- Sign in and buy Pro Semester here
One Pro Semester membership works in both the extension and the app.