100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Code: AC11 Subject: OBJECT ORIENTED PROGRAMMING $18.49   Add to cart

Exam (elaborations)

Code: AC11 Subject: OBJECT ORIENTED PROGRAMMING

 9 views  0 purchase
  • Course
  • OBJECT ORIENTED PROGRAMMING
  • Institution
  • OBJECT ORIENTED PROGRAMMING

Each Question carries 2 marks. Choose correct or the best alternative in the following: Q.1 The address of a variable temp of type float is (A) *temp (B) &temp (C) float& temp (D) float temp& Ans: B Q.2 What is the output of the following code char symbol[3]={‘a’,‘b’,�...

[Show more]

Preview 4 out of 194  pages

  • August 10, 2024
  • 194
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
  • OBJECT ORIENTED PROGRAMMING
  • OBJECT ORIENTED PROGRAMMING
avatar-seller
StudyCenter1
Code: AC11 Subject: OBJECT ORIENTED PROGRAMMING
PART - I, VOL – I

TYPICAL QUESTIONS & ANSWERS

OBJECTIVE TYPE QUESTIONS


Each Question carries 2 marks.

Choose correct or the best alternative in the following:

Q.1 The address of a variable temp of type float is
(A) *temp (B) &temp
(C) float& temp (D) float temp&

Ans: B

Q.2 What is the output of the following code
char symbol[3]={‘a’,‘b’,‘c’};
for (int index=0; index<3; index++)
cout << symbol [index];
(A) a b c (B) “abc”
(C) abc (D) ‘abc’

Ans: C

Q.3 The process of building new classes from existing one is called ______.
(A) Polymorphism (B) Structure
(C) Inheritance (D) Cascading

Ans: C

Q.4 If a class C is derived from class B, which is derived from class A, all through public
inheritance, then a class C member function can access
(A) protected and public data only in C and B.
(B) protected and public data only in C.
(C) private data in A and B.
(D) protected data in A and B.

Ans: D

Q.5 If the variable count exceeds 100, a single statement that prints “Too many” is
(A) if (count<100) cout << “Too many”;
(B) if (count>100) cout >> “Too many”;
(C) if (count>100) cout << “Too many”;
(D) None of these.
1

,Code: AC11 Subject: OBJECT ORIENTED PROGRAMMING


Ans: C

Q.6 Usually a pure virtual function
(A) has complete function body.
(B) will never be called.
(C) will be called only to delete an object.
(D) is defined only in derived class.

Ans: D

Q.7 To perform stream I/O with disk files in C++, you should
(A) open and close files as in procedural languages.
(B) use classes derived from ios.
(C) use C language library functions to read and write data.
(D) include the IOSTREAM.H header file.

Ans: B

Q.8 Overloading the function operator
(A) requires a class with an overloaded operator.
(B) requires a class with an overloaded [ ] operator.
(C) allows you to create objects that act syntactically like functions.
(D) usually make use of a constructor that takes arguments.

Ans: A

Q.9 In C++, the range of signed integer type variable is ________
(A) 0 to 216 (B) − 215 to 215 − 1
(C) − 2 7 to 2 7 − 1 (D) 0 to 2 8

Ans: B

Q.10 If x = 5, y = 2 then x ∧ y equals________.
(where ∧ is a bitwise XOR operator)
(A) 00000111 (B) 10000010
(C) 10100000 (D) 11001000

Ans: A

Q.11 If an array is declared as
int a[4] = {3, 0, 1, 2}, then values assigned to a[0] & a[4] will be ________
(A) 3, 2 (B) 0, 2
(C) 3, 0 (D) 0, 4

Ans: C

2

,Code: AC11 Subject: OBJECT ORIENTED PROGRAMMING


Q.12 Mechanism of deriving a class from another derived class is known as____
(A) Polymorphism (B) Single Inheritance
(C) Multilevel Inheritance (D) Message Passing

Ans: C

Q.13 RunTime Polymorphism is achieved by ______
(A) friend function (B) virtual function
(C) operator overloading (D) function overloading

Ans: B

Q.14 A function call mechanism that passes arguments to a function by passing a copy of the values
of the arguments is __________
(A) call by name (B) call by value
(C) call by reference (D) call by value result

Ans: B

Q.15 In C++, dynamic memory allocation is accomplished with the operator ____
(A) new (B) this
(C) malloc( ) (D) delete

Ans: A

Q.16 If we create a file by ‘ifstream’, then the default mode of the file is _________
(A) ios :: out (B) ios :: in
(C) ios :: app (D) ios :: binary

Ans: B

Q.17 A variable defined within a block is visible
(A) from the point of definition onward in the program.
(B) from the point of definition onward in the function.
(C) from the point of definition onward in the block.
(D) throughout the function.

Ans: C

Q.18 The break statement causes an exit
(A) from the innermost loop only. (B) only from the innermost switch.
(C) from all loops & switches. (D) from the innermost loop or switch.

Ans: D

Q.19 Which of the following cannot be legitimately passed to a function
3

, Code: AC11 Subject: OBJECT ORIENTED PROGRAMMING

(A) A constant. (B) A variable.
(C) A structure. (D) A header file.

Ans: D

Q.20 A property which is not true for classes is that they
(A) are removed from memory when not in use.
(B) permit data to be hidden from other classes.
(C) bring together all aspects of an entity in one place.
(D) Can closely model objects in the real world.

Ans: C

Q.21 You can read input that consists of multiple lines of text using
(A) the normal cout << combination.
(B) the cin.get( ) function with one argument.
(C) the cin.get( ) function with two arguments.
(D) the cin.get( ) function with three arguments.

Ans: C

Q.22 The keyword friend does not appear in
(A) the class allowing access to another class.
(B) the class desiring access to another class.
(C) the private section of a class.
(D) the public section of a class.

Ans: C

Q.23 The process of building new classes from existing one is called
(A) Structure. (B) Inheritance.
(C) Polymorphism. (D) Template.

Ans: B

Q.24 If you wanted to sort many large objects or structures, it would be most efficient to

(A) place them in an array & sort the array.
(B) place pointers to them in an array & sort the array.
(C) place them in a linked list and sort the linked list.
(D) place references to them in an array and sort the array.

Ans: C

Q.25 Which statement gets affected when i++ is changed to ++i?
(A) i = 20; i++;
(B) for (i = 0; i<20; i++) { }
4

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller StudyCenter1. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $18.49. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

77254 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$18.49
  • (0)
  Add to cart