[go: up one dir, main page]

0% found this document useful (0 votes)
60 views5 pages

Question Bank MCQs - OOPM CS 305

Uploaded by

devendra12052005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views5 pages

Question Bank MCQs - OOPM CS 305

Uploaded by

devendra12052005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Question Bank (CS305 Object Oriented Programming & Methodology)

1. Explain the difference between OOP & POP ?

2. What are the advantages and Disadvantages of Object oriented programming?

3. What is scope resolution operator Explain with example?

4. How to implement data members and member function of class?

5. Explain Access Specifiers in C++?

6. Explain various features of Object oriented programming.

7. Explain Input output stream in C++ with example?

8. What is constructor and types of constructor? Explain with suitable example?

9. Explain Static variable and how to implement static variable in class?

10. Explain various types of object Models?


Multiple Choice Questions

Q1. Object is combination of


a. Data
b. Function
c. Data and function
d. None of these
Ans.c

Q2. Class is a collection of


a. Objects
b. Similar objects
c. Different objects
d. None of these
Ans. b

Q3. Data encapsulation is a method to create


a.class
b.object
c. Function
d. Data
Ans.b

Q4. Data Abstraction method focus on


a.class
b.information
c. Instruction
d.expalnation
Ans b

Q5. Visibility mode / access specifier are


a.private
b. Protected
c. Public
d. all of above
Ans.d

Q6. Reusability achieved by


a.polymorphism
b. Function
c. Inheritance
d. Dynamic binding
Ans.c

Q7. Objects are communicate through


a.message passing
b. Message sending
c. Object interaction
d. All of above
Ans. D

Q8. Compiler operations are


a.uncover errors
b. Convert codes
c. Start compilation from main function
d. All of above
Ans. d

Q9. Inline function


a.increase speed of the program
b. reduce compiler extra overhead
c. can write 2 or 3 codes within it
d. all of above
Ans.d

Q10. Which is not valid syntax to acess function


a.obj.getdata()
b.obj::getdata()
c.obj->getdata()
d.obj:getdata()
ans d

Q.11 Predict the Output


class Test {
int x;
};
int main()
{
Test t;
cout << t.x;
return 0;
}
a. 0
b. Garbage Value
c. Compiler Error
Ans . C

Q. 12 Which of the following is true?


A. All objects of a class share all data members of class
B Objects of a class do not share non-static members. Every object has its own copy.
C Objects of a class do not share codes of non-static methods, they have their own copy
D None of the above
Ans . B

Q.13 A member function can always access the data in __________ , (in C++).
A. All objects of a class share all data members of class
B. Objects of a class do not share non-static members. Every object has its own copy.
C. Objects of a class do not share codes of non-static methods, they have their own
copy
D. None of the above
Ans . A
Q.13 In CPP, members of a class are ______ by default.
A. Public
B. Private
C. Protected
D.Static
Ans . B
Q.14 An expression A.B in C++ means ____
A. A is member of object B
B. B is member of Object A
C. Product of A and B
D. None of these
Ans . B

Q.15 A C++ code line ends with ___


A. A Semicolon (;)
B. A Fullstop(.)
C. A Comma (,)
D. A Slash (/)
Ans . A

Q 16 - Choose the invalid identifier from the below


A - Int
B - bool
C - DOUBLE
D - __0__
Ans . B
Q.17 Which of the following is not a type of constructor?
A. Copy constructor
B. Friend constructor
C. Default constructor
D. Parameterized constructor
Ans . B

Q. 18 Which of the following term is used for a function defined inside a class?
A. Member Variable
B. Member function
C. Class function
D. Classic function
Ans . B

Q.19 cout is a/an __________ .

A. operator
B. function
C. object
D. macro
Ans . C

Q.20 Which of the following statement is correct?


A. A constructor is called at the time of declaration of an object.
B. A constructor is called at the time of use of an object.
C. A constructor is called at the time of declaration of a class.
D. A constructor is called at the time of use of a class.
Ans . A

Q.21 Which of the following approach is adapted by C++?


A. Top-down
B. Bottom-up
C. Right-left
D. Left-right
Ans . B

Q.22 Which of the following operator is overloaded for object cout?


A. >>
B. <<
C. +
D. =
Ans . B

Q.23 Which of the following is the correct class of the object cout?

A. iostream
B. istream
C. ostream
D. ifstream
Ans . C

You might also like