Skip to content
VUBuddy

CS304 Final Term Quiz Spring 2026

Object Oriented Programming PDF 602 KBUpdated 23 Oct 2026
Final term past paper CS304 Final Term Quiz Spring 2026 PDF 602 KB
vubuddy.com
Type
Final term past paper
Course
CS304 Object Oriented Programming
Size
PDF 602 KB
Updated
23 Oct 2026
Free download 0 of 3 used today
Download free · 602 KB

You get 3 free files a day on the website. Add the Chrome extension for 30 a day.

Unlimited downloads in the Android app Get it free on Google Play

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

  1. Which operator is used for stream insertion in C++? A) >> B) << C) <- D) ->

Correct option: B

  1. Which operator is used for stream extraction? A) << B) >> C) != D) ==

Correct option: B

  1. 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

  1. ios

Correct option: B

  1. 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

  1. What is the return type of an overloaded stream insertion operator for chaining? A) void B) int C) ostream & D) istream &

Correct option: C

  1. Where is the default output stream? A) File B) Network socket C) Console D) Printer

Correct option: C

  1. 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

  1. 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

All CS304 files →
CS304 Object Oriented Programming All CS304 handouts, past papers, quizzes and MCQs in one place. Open course page

Get more out of VUBuddy, for free

Android app Free on Google Play
  • Unlimited downloads
  • The explanation behind every MCQ answer
  • Study offline on slow data
Get the Android app
Chrome extension Free on the Chrome Web Store
  • 30 downloads a day instead of 3
  • Sign in and buy Pro Semester here
Add to Chrome

One Pro Semester membership works in both the extension and the app.