Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

Code: AC11 Subject: OBJECT ORIENTED PROGRAMMING

Rating
-
Sold
-
Pages
194
Grade
A+
Uploaded on
10-08-2024
Written in
2024/2025

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; index3; 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 (count100) cout “Too many”; (B) if (count100) cout “Too many”; (C) if (count100) cout “Too many”; (D) None of these. 2 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 constructo

Show more Read less
Institution
OBJECT ORIENTED PROGRAMMING
Course
OBJECT ORIENTED PROGRAMMING

Content preview

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

Written for

Institution
OBJECT ORIENTED PROGRAMMING
Course
OBJECT ORIENTED PROGRAMMING

Document information

Uploaded on
August 10, 2024
Number of pages
194
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$18.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
StudyCenter1 Teachme2-tutor
Follow You need to be logged in order to follow users or courses
Sold
227
Member since
2 year
Number of followers
91
Documents
3850
Last sold
3 days ago
Nursing school is hard! Im here to simply the information and make it easier!

My mission is to be your LIGHT in the dark. If you"re worried or having trouble in nursing school, I really want my notes to be your guide! I know they have helped countless others get through and thats all i want for YOU! Stay with me and you will find everything you need to study and pass any tests,quizzes abd exams!

4.3

28 reviews

5
18
4
4
3
4
2
0
1
2

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions