C++

Advanced C++ : Introduction to C++ & C++ Structures | by Khushboo Patel |  Medium

 Object Oriented Programming



MCQ

 

1)Instructions are organized into groups known as _____

a)Function

b)Class

c)Both a) and b)

d)None of above

Ans: a) Function

2)Flowchart is used to represent________from one action to another.

a)Function

b)Class

 c)Flow of control

d)None of above

Ans: c) Flow of control

3)Which type of data may be accessed by all the function.

 a)Private

b)Global 

c)Public

d)All of above

Ans: b) Global

4)Which approach is used to program design in object oriented programming.

a)Top-down

b)Top-top

c)Bottom-up

d)None of above

Ans: c) Bottom-up

5)The problem is decomposed into number of entities called________.

a)Function

 b)Object

c)Variable

d)Element

Ans: b) Object

6)Object may communicate with each other through____

a)Class

b)Function

c)Subject

d)Variable

Ans: b) Function

7)Objects may represent_____

a)Person

b)Place

c)Bank account

d)All of above

Ans: d) All of above

8)Each object contain _____and__________to manipulate the data.

a)Data and address

b)Address and code

c)Data and code

d)None of above

Ans: c) Data and code

9)The entire set of data and code of an object can be combined together with the help of________

a)Object

 b)Class

c)Function

d)Variable

 Ans: b) Class

10)A class is a collection of________

a)Object

b)Variable

c)Function

d)None of above

Ans: a) Object

11)A class is a ________data type.

a)Integer

b)Float

c)Predefined

d)User defined

Ans: d) User defined

12)Process of using same operand, operator to perform different type of operation is called_______

a)Operand overloading

b)Operator overloading

c)Function overloading

d)All of above

Ans: b) Operator overloading

13)Using a single function name to perform different types of tasks is known as_______

a)Operator overloading

b)Operand overloading

c)Function overloading

d)All of above

Ans:c)Function overloading

14)What is the output of bellows program?

#include<iostream.h>

int main()

{

cout<<”Welcome in c++”;

return 0;

}

 

a)Cout

b)cout<<”Welcome in c++”

c)Welcome in c++

d)welcome in c++

Ans: c) Welcome in c++

15)A class is a________data type.

a)Integer

 b)Float

 c)Predefined

 d)User defined

 Ans: d) User defined

 16)A wrapping up of data and function into a single unit is known as ________

a)Encapsulation

 b)Inheritance

 c)Polymorphism

 d)All of above

Ans: a) Encapsulation

17)The classes use the concept of data abstraction so they known as

a)Abstraction

b)Encapsulation

c)Insertion

 d)None of above

Ans: a) Abstraction

18)Dynamic binding is associated with ______

a)Polymorphism & Inheritance

b)Polymorphism & Manipulation

c)Inheritance & Manipulation

d)All of above.

Ans: a) Polymorphism & Inheritance

19)Correct arrangement of following steps

i)Creating object from class definition

ii)Establishing communication among object.

iii)Creating classes that define objects & their behaviours.

a)i) ,ii) , iii)

b)ii) , i) ,iii)

c)iii) , i) , ii)

d)iii) , ii) , i)

Ans: c) iii) , i) , ii)

20)which of the following are benefits of OOP.

a)Reusability

b)Easy tounderstand

c)Models are real world well

d)All of above

Ans: d) All of above

21)C++ is an

a)OOP

b)POP

c)OPO

d)None of above

Ans: a) OOP

22)OOP stands for

a)Object Organization Programming

b)Object Oriented Programming

c)Procedure Oriented Programming

d)None of above

Ans: b) Object Oriented Programming

23)C++ developed by

a)Bjarne Stroustrup

b)Nothing

c)Both a) and b)

d)None of above

Ans: a) Bjarne Stroustrup

24)C++ statements terminate with

a);

b).

c):

d)*

Ans: a) ;

25)The operator << is called

a)Insertion

b)Extraction

c)Deletion

 d)All of above

Ans: a) Insertion

26)The operator >> is called

a)Insertion

b)Extraction

 c)Deletion

d)All of above

Ans: b) Extraction

 27)A typical C++ program contains______sections.

a)Three

b)Four

 c)Five

 d)Six

 Ans:-b) Four

28)Which of the following is predefined object

a)cin

b)cout

c)Both a) and b)

d)None of above

Ans: c) Both a) and b)

 29)cout identifier used to

 a)Display an output

b)Display an input

c)Both a) and b)

d)None of above

Ans: a) Display an output

30)In C++ command starts with

 a)/*command*/

b)//command

c)/.command./

d)*/command/*

Ans: b) //command

31)Scope resolution operator is denoted by

a).

b):

c)::

d).*

Ans: c) ::

32)Pointer to member declaration is denoted by

a)::

b)::*

c):*

d)*

Ans: b) ::*

33)Pointer to member operator is denoted by

a)->*

b)*

c).*

d)Both a) and b)

Ans: d) Both a) and b)

34)Memory release operator is denoted as

a)insert

b)del

c)delete

d)All of above

A5s: c) delete

36)Line feed operator is denoted as

a)lend

b)endl

c)del

d)None of above

Ans: b) endl

36)The inline keyword sends

a)A request not a command

b)A request and command

c)Both a) and b)

d)None of above

Ans: a) A request not a command

37)The same function name to creates functions that perform different tasks,this is known as

a)Inheritance

b)Function polymorphism

c)Function

d)All of above

Ans: b) Function polymorphism

38)Which of the following are visibility modes/visibility labels

 a)Private

 b)Public

 c)Both a) and b)

d)None of above

Ans: c) Both a) and b)

39)The visible declared inside the class are known as

a)Datamembers

b)Variables

c)Arguments

 d)All of above

 Ans: a) Datamembers

40)The function declared inside the class are known as

a)Datamembers

 b)Member functions

c)Variables

d)Arguments

Ans: b) Member functions

 41)Binding data & functions together into a single class type variable is known as

a)Inheritance

 b)Binding

c)Encapsulation

d)None of above

Ans: c) Encapsulation

42)A static member function can be called using

a)Classname

b)Variable

c)Arguments

d)All of above

Ans: a) classname

43)The old class is known as

a)Derived class

b)Base class

c)Both A and B

d)Name of above

Ans: b) base class

44)Memory release operator is denoted as

a)Insert

b)Del

c)Deleted

d)All of above

Ans:c) delete

45)Line feed operator

a)lend

b)endl

c)del

d)None of above

Ans:endl

46)The new class is known as

a)Derived class

b)Base class

c)Both a and b

d)None of above

Ans:a) derived class

47)The derived class inherit

a)First property from base class

b)Same or all properties from base class

c)Same or all properties from derived class

d)Both b and c

Ans:b)Same or all properties from base class

48)How many types of inheritance

a)Two

b)Three

c)Four

d)Five

Ans:d) five

49)Which of the following are types of inheritance.

a)Single

b)Double

c)Multiple

d)Both a and c

Ans: d) Both a and c

50)Following is the diagrammatic representation of

a)Single Inheritance

b)Double Inheritance

c)Multilevel Inheritance

d)Hierarchical Inheritance

Ans:a) Single Inheritance

51)A derived class with only one base class is called

a)Multiple

b)Hierarchical

c)Single

d)Double

Ans:c)single

52)A derived class with more than one base classes is called

a)Multiple inheritance

b)Hierarchical

c)Single

d)Double

Ans:a) Multiple inheritance

53)The properties of one class many be inherited by more than name class this process is known as

a)Multiple

b)Hierarchical

c)Single

d)Double

Ans:b) Hierarchical

54)The mechanism of deriving a class from another derived class is called......

a)Multiple

b)Multilevel

c)Hybrid

d)Single

Ans:b)multilevel

55)The concept of deriving a new class with two or more than two types of inheritance is called -----

a)Multiple

b)Multilevel

c)Hybrid

d)Single

Ans:c) hybrid

 

 

 


Comments

Post a Comment

Popular posts from this blog

DATA STRUCTURE - Searching methodes

Data structure - Sorting methodes

Cpp-Program for Constructor and Distructure with Output