Skip to content
VUBuddy

CS304 Midterm MCQs with References by Moaaz

Object Oriented Programming PDF 326 KBUpdated 23 Oct 2026
Midterm past paper CS304 Midterm MCQs with References by Moaaz PDF 326 KB
vubuddy.com
Type
Midterm past paper
Course
CS304 Object Oriented Programming
Size
PDF 326 KB
Updated
23 Oct 2026
Free download 0 of 3 used today
Download free · 326 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 21. Download the file for all 21 pages.

Spring 2010

Q1. Which part of an object exhibits its state? (1 marks)

  1. Data (Page 23)
  2. Operations
  3. Any public part
  4. Any private part

Correct answer: Data (Page 23)

Q2. (1 marks)

  1. organize data.
  2. pass arguments to objects of classes.
  3. add features to existing classes without rewriting them. (Page 27)
  4. improve data-hiding and encapsulation.

Correct answer: add features to existing classes without rewriting them. (Page 27)

Q3. Suppose you have been given the following design, (1 marks)

"A person has a name, age, address and sex. You are designing a class to represent a type of person called a patient. This kind of person may be given a diagnosis, have a spouse and may be alive". Given that the person class has already been created, what of the following would be appropriate to include when you design the patient class?

  1. age and sex
  2. sex and diagnosis
  3. diagnosis and age

Q4. What problem(s) may occur when we copy objects without using deep copy constructor? (1 marks)

  1. Dangling pointer
  2. Memory Leakage
  3. All of the given (Page 147)
  4. System crash

Correct answer: All of the given (Page 147)

Q5. this pointers are not accessible for static member functions. (1 marks)

  1. True (Page 114)
  2. False

Correct answer: True (Page 114)

Q6. A static member function cannot be declared. (1 marks)

  1. Static
  2. Implicit
  3. Explicit

Q7. _______ remain in memory even when all objects of a class have been destroyed. (1 marks)

  1. Static variables (Page 111)
  2. Instance variable
  3. Primitive variables
  4. None of given

Correct answer: Static variables (Page 111)

Q8. Friend functions are _____________ functions of a class. (1 marks)

  1. None of given
  2. object member
  3. non-member (Page 136)
  4. data member

Correct answer: non-member (Page 136)

Q9. ___________, 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. (1 marks)

  1. Friendship is one way only
  2. Friendship is two way only
  3. NO Friendship between classes
  4. Any kind of friendship

Correct answer: Friendship is one way only

Q10. The statement objA=objB; will cause a compiler error if the objects are of different classes. (1 marks)

  1. True
  2. False

Correct answer: True

Q11. call? (1 marks)

  1. Rational_number operator+( Rational_number & obj);
  2. Rational_number operator+(double& obj); (Page 145)
  3. Rational_number operator+(Rational_number &obj, double& num);
  4. operator+(double& obj);

Correct answer: Rational_number operator+(double& obj); (Page 145)

Q12. Which operator can not be overloaded? (1 marks)

  1. The relation operator ( >= )
  2. Assignment operator ( = )
  3. Script operator ( [] )
  4. Conditional operator (? : ) (Page 141)

Correct answer: Conditional operator (? : ) (Page 141)

Q13. To convert from a user-defined class to a basic type, you would most likely use (1 marks)

  1. a built-in conversion operator.
  2. a one-argument constructor.
  3. an overloaded = operator.
  4. a conversion operator that’s a member of the class.

Correct answer: a conversion operator that’s a member of the class.

Q14. The technique in which we visualize our programming problems according to real life’s problems is called (1 marks)

  1. structured programming
  2. object oriented Programming

Correct answer: object oriented Programming

(Page 9)

  1. procedural programming
  2. non of the given

Q15. In object orientated programming, a class of objects cans _____________ properties from another class of objects (1 marks)

  1. Utilize
  2. Borrow
  3. Adopt
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.