CS 304 object oriented programming #Current Solved Grand Quiz Mid Term Preparation # 2021

0
110
CS 304 object oriented programming #Current Solved Grand Quiz Mid Term Preparation # 2021
CS 304 object oriented programming #Current Solved Grand Quiz Mid Term Preparation # 2021

CS 304 object oriented programming #Current Solved Grand Quiz Mid Term Preparation # 2021

Consider the statement “room has chair” Which of the following types of association exist between room and chair?

  1. inheritance
  2. composition
  3. There is no association
  4. Aggregation

Consider the following code segment :

class test

{

int a;

int b;

int c;

  1. 5, 5, 5
  2. 5, junk value, 5
  3. junk value, 5, junk value
  4. junk value, 5,5

Member function defined inside a class declaration are ________ by default.

  1. Visible
  2. Public
  3. Private
  4. Protected

A post-fix unary operator is implemented in C++ using member function with:

  1. 1 dummy char argument
  2. 1 dummy int argument
  3. 1 dummy float argument
  4. None of the given option

Suppose person is a class, which of the following statement define object of class person ?

  1. Create person object;
  2. Define Object;
  3. Person person;
  4. Object person;

CS 304 object oriented programming #Current Solved Grand Quiz Mid Term Preparation # 2021

__________ is the reverse process of Generalization.

  1. Aggregation
  2. Inheritance
  3. Dependence
  4. Specialization

If you have three classes in a C++ program A, B and C  where class A inherits from class B, then class_________contains all the character of class________

  1. B, A
  2. A, B
  3. A, C
  4. B, C

Which of the following is true about inline function?

  1. It is used by compliers to improve efficiency of the program
  2. Small size function that need to be called many times during program execution are decaled inline
  3. Inline function decrease the code execution time
  4. All of the given option

What is a class?

  1. A class is  section of computer memory containing objects
  2. A class is a section of the hard disk reserved for object oriented programs
  3. A class is the part of an object that contains the variables.
  4. A class is a description of a kind of object

Composition is ________ relationship

  1. is a
  2. is kind a
  3. Has 
  4. part-whole

_________ represents ” IS a ” relationship.

  1. Simple Association
  2. Inheritance
  3. Composition
  4. Aggregation

A class can have only ________ destructor.

  1. One 
  2. Two
  3. Three
  4. Four

Student *ptr = new Student(“ALI”); is an example of _______

  1. Static memory allocation
  2. Dynamic memory allocation
  3. Destructor
  4. Constructor

Inheritance is shown by;

  1. Open head arrow
  2. Filled arrow
  3. Single Line
  4. Bi-directional

Compile generated default constructor is called ________ and user written default constructor is called

  1. Compiler-defined, Implicit
  2. Explicit, User-defined
  3. Explicit, Implicit
  4. Implicit, Explicit

Entities in OO model are represented by;

  1. Circle
  2. Square
  3. Lines
  4. Rectangle 

Which of the following concept is more close to encapsulation

  1. Exception handling
  2. Inheritance
  3. Polymorphism
  4. information hiding

In________ a pointer or reference to an object is created inside a class

  1. aggregation
  2. Composition
  3. Separation
  4. None of the given

Polymorphism makes the system

  1. reusable
  2. flexible
  3. faster
  4. All of the given option

A child inherits characteristics from its__________

  1. Neighbor
  2. parent
  3. sibling
  4. itself

How can we identify classes from a given problem statement?

  1. By extracting Nouns from problem statement
  2. By extracting verbs from problem statement
  3. By extracting adjective from problem statement
  4. All of the given option

Aggregation between objective shows that__________

  1. Objects have strong relationship
  2. Objects have weak relationship 
  3. Objects have no relationship
  4. Objective have hierarchical relationship

Choose the correct option

  1. constructors cannot be const
  2. Destructors cannot be const.
  3. Constructors and Destructors are used to modify the object to a well-defined state.
  4. All of the given options

Through interface access object’s__________

  1. States
  2. Data members
  3. Behavior
  4. Class

All objects of same class has_____________attributes.

  1. Different
  2. Equal
  3. Same
  4. None of the given option

In __________ base class can be replaced by the derived class.

  1. Aggregation
  2. Inheritance
  3. Dependency
  4. Extension

Which of the following can only be overloaded as member function of the class?

  1. Equality operator: ==
  2.  Inequality operator: !=
  3. Function operator: ()
  4. Stream extraction operator: >>

Which of the following is an example of objects in school?

  1. Car, Chair
  2. Student, Teacher
  3. Teacher, Height
  4. Book, Pages

In OOP we can achieve reusability through?

  1. Inheritance
  2. Encapsulation
  3. Aggregation
  4. Association

Subtyping means that derived class is behaviorally _________ with the base class.

  1. Same
  2. Compatible
  3. Different
  4. Incompatible

Which of the following can be used as an alternative to static members?

  1. Local Variables
  2. Global Variables
  3. Constant Variable
  4. Array of objects

_________ operator is used to create objects at run time

  1. create
  2. new
  3. dynamic
  4. subscript

Identify the common attributes of the given scenario:

Circle has color, vertices, and radius

Triangle has color, vertices, and angle

  1. Color, Vertices
  2. vertices, Radius
  3. Color, Angle
  4. Vertices, Radius

Inheritance is shown by:

  1. Open head arrow
  2. Filled arrow
  3. Single Line
  4. Bi-directional

In expression c1*c2+c3-c4 which of the following will be executed in first order?

  1. c1*c2
  2. c2+c3
  3. c3-c4
  4. c1-c4

An object has attribute, operations, and__________

  1. Unique Identity
  2. Behavior
  3. Characteristics
  4. All of these

Suppose a class does not have any constructor. what will happen when an object of this class is created ?

  1. Compiler will generate syntax error
  2. Run time error will occur
  3. Compiler will call implicit default constructor
  4. None of the given options

Hiding the implementation details makes program:

  1. Easy to understand 
  2. More complex
  3. Provide more features
  4. Logical

In object oriented programming, objects communicate with each other through________

  1. Message 
  2. Data member
  3. Voice chat
  4. Ports

Which of the following operator(s) take(s) one or no argument if overloaded?

  1. ++
  2. *
  3. %
  4. All of the given option

What is meant by multiple inheritance?

  1. Deriving a base class from derived class
  2. Deriving a derived class from base class
  3. Deriving a derived class from more than one base class
  4. None of the given option

Through_________,objects communication which outer world.

  1. Encapsulation
  2. Interface
  3. Inheritance
  4. Polymorphism

Information hiding can be achieved through__________

  1. Encapsulation, Inheritance
  2. Encapsulation, Polymorphism
  3. Encapsulation, Abstraction
  4. Encapsulation, Overloading

More Quizs Preparation Mid Term

  1. CS 502 – SOLVED GRAND QUIZS PREPARATION
  2. ENG 101 – SOLVED GRAND QUIZS PREPARATION
  3. CS 302 – SOLVED GRAND QUIZS PREPARATION
  4. ENG 201 – SOLVED GRAND QUIZS PREPARATION
  5. CS 502 – SOLVED GRAND QUIZS PREPARATION

LEAVE A REPLY

Please enter your comment!
Please enter your name here