Wednesday, November 14, 2012

.::VULMSIT::.eNoxel.com CS304 Quiz No.1 Nov 14, 2012

CS304 - Object Oriented Programming

Quiz No.1

14th Nov 2012

When we create objects, then space is allocated to:

Member functions

Access specifier

Data members

None of the given

 

If we extend our model, and the rest of model is not affected, then its called ___________

Consistency

Flexibility

Efficiency

Reusability

 

Using encapsulation we can achieve

Information hiding

Least interdependencies among modules

Implementation independence

All of given options

 

Consider the statement "room has chair" which of the following type of association exists between room and chair?

Inheritance

Composition

There is no association

Aggregation

 

A good model is ................ related to a real life problem.

Loosely

Openly

Closely

Not

 

If a class A inherits from class B, then class A is called.

Child Class

Derived class

Parent class

Child and derived class

 

Which one of the following is not a major element in an object model?

Abstraction

Encapsulation

Persistence

Hierarchy

 

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

Visible

Public

Private

Changed

 

Advantage(s) of information hiding

Simplifies the model

Restriction to change

Both of above

None of the above

 

Which of the following parts of an object exhibits its state?

Data

Operations

Any public part

Any private part

 

Without using Deep copy constructor. A___________ problem can occur

System crash

Memory

Leakage

Dangling printer

All the given

 

Three main characteristics of "Object Oriented programming" are, 

Encapsulation, dynamic binding, polymorphism

Polymorphism, overloading, overriding

Encapsulation, inheritance, dynamic , binding

Encapsulation, inheritance, polymorphism

 

Overriding concept is used in"

Encapsulation

Polymorphism

Information hiding

None of the given

 

Main advantage of inheritance is:

Better understanding

Les understating

Reuse

Less complexity

 

Which one is a class association

Simple association

Inheritance

Composition

Aggregation

 

Public member function exposed by a class is called surface

True

False

 

Constructor and destructor can be declared constant

True

False

 

Which can allocate dynamic memory allocation through______ keyword.

Static

Global

New

Const

 

In inheritance, a child class is sub-type of base class.

True

False

 

If only one behaviour of a derived class is incompatible with base class, then it is:

Generalization

Specification

Extension

Inheritance

 

"A fan has wings". Which type of relation exists between fan and wings in the sentence?

Aggregation

Association

Generalization

Composition

 

 

 

When an object initialize _________ automatically call by the complier

Constructor

Function

Object

None of the given

 

A class __________ destructor.

No

One

Two

Three

 

Suppose there is an object of type person, which of the following can be considered as one of its attributes

Name

Age

Work ()

Both name and Age

 

If MyClass has destructor named?

MyClass

~MyClass

My~Class

MyClass~

 

An abstract class shows _______ behaviour.

Overriding

Specific

General

None of the given

 

The _________ keyword tells the compiler to substitute the code within the function definition for every instance of a function call.

Virtual

Inline

Instance

None of the given

 

 

 

 

 

 

 

 

 

We can choose any arbitrary name for a constructor. 
Select correct option: 
True

False

 

Which one is not the main feature of object oriented programming? 
Select correct option: 
Classes and Objects 
Exception handling 
Inheritance 
Polymorphism 

The dot operator (or class member access operator) connects the following two entities (reading from left to right): 
Select correct option: 
A class member and a class object 
A class object and a class 
A class and a member of that class 
A class object and a member of that class 

If only one behaviour of a derived class is incompatible with base class, then it is: 
Select correct option: 
Generalization 
Specialization 
Extension 
Inheritance 


Storing data and functions in a single unit (class). Data cannot be accessible to the outside world and only those functions which are stored in the class can access it 
Select correct option: 
Inheritance 
Abstraction 
Polymorphism 
Encapsulation 


If MyClass has a destructor what is the destructor named? 
Select correct option: 
MyClass
~MyClass
My~Class
MyClass~

A real world object can be transformed into programming entity by defining its respective 
Select correct option: 
Class 
Function 
Only states 
Only behaviour 

Which of the following features of OOP is used to deal with only relevant details? 
Select correct option: 
Abstraction 
Information hiding 
Object 
Inheritance 

In class, attributes and behaviour is represented by: 
Select correct option: 
Member functions, data members 
Member functions, scope of data members 
Data members, member functions 
None of the given 


Using encapsulation we can achieve 
Select correct option: 
Information hiding 
Least interdependencies among modules 
Implementation independence 
All of given options 

Information hiding can be achieved through__________.

Encapsulation, Inheritance

Encapsulation, Polymorphism

Encapsulation, Abstraction

Overloading

 

A good model is ................ related to a real life problem.

Select correct option:

Loosely

Openly

Closely

 

 

 

 

 

Which of the following features of OOP is used to derive a class from another?

Select correct option:

Encapsulation

Polymorphism

Data hiding

Inheritance

 

Which of the following is a weak relationship between two objects?

Select correct option:

Inheritance

Composition

Aggregation

None of given

 

Data items in a class must be private.

Select correct option:

True

False

 

Which one is a class association?

Select correct option:

Simple Association

Inheritance

Composition

Aggregation

 

Suppose there is an object of type Person, which of the following can be considered as one of its attributes

Select correct option:

Name

Age

Work()

Both Name and Age

Question # 8 of 10 ( Start time: 01:17:52 AM ) Total M a r k s: 1

Which one is not an object association?

Select correct option:

Simple association

Inheritance

Aggregation

Association

 

Using encapsulation we can achieve

Select correct option:

Information hiding

Least interdependencies among modules

Implementation independence

All of given options

 

In constant member function the type of this pointer is:

Select correct option:

Constant pointer

Constant pointer to object

Constant pointer to class

Constant pointer to constant object

 

Which of the following is the way to extract common behavior and attributes from the given classes and make a separate class of those common behaviors and attributes?

Generalization

Sub-typing

Specialization

Extension

 

The ability to derive a class from more than one class is called

Single inheritance

Encapsulation

Multiple inheritance

Polymorphism

 

If MyClass has a destructor what is the destructor named?

MyClass

~MyClass

My~Class

MyClass~

 

Class abc{ ----- }; Is a valid class declaration?

yes

no

 

Without using Deep copy constructor, A ____________ problem can occur

System crash

Memory Leakage

Dangling pointer

All of the given

If only one behaviour of a derived class is incompatible with base class, then it is:

Generalization

Specialization

Extension

Inheritance

 

Which of the following may not be an integral part of an object?

state

behavior

Protected data members

All of given

 

Only tangible things can be chosen as an object.

True

False

Class is not a mechanism to create objects and define user data types.

true

false


Memory is allocated to non static members only, when:

Class is created

Object is defined

Object is initialized

Object is created


The sub-object's life is not dependent on the life of master class in ___________.

Composition

Aggregation

Separation

non of the given


Unary operators and assignment operator are right associative.

true

false



The >= operator can't be overloaded.

true

false


_____ is creating objects of one class inside another class.

Association

Composition

Aggregation

Inheritance


If we are create array of objects through new operator, then

We can call overloaded constructor through new

We can't call overloaded constructor through new

We can call default constructor through new

None of the given


Object can be declared constant with the use of Constant keyword.

true

false

 

__________ Operator will take only one operand.

New

int

object

none of the given


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

++

*

%

All of the given choices


this pointer does not pass implicitly to __________ functions.

Static Member

Non-Static Member

Instance Number

None of the given



Operator overloading is

making C++ operators work with objects.

giving C++ operators more than they can handle.

giving new meanings to existing Class members.

making new C++ operators

 

Which of the following is TRUE,

Derived class pointer can be used as Base class pointer

Base class pointer can be used as Derived class pointer

Both of these options

None of these options

 

___________ Binding means that target function for a call is selected at run time

Automatic

Dynamic

Static

Dramatic

 

When we want to implement one class in terms of another class then we use

Public inheritance

Protected inheritance

Private inheritance

None of these options

 

Consider the code below, class c1{ }; class c2 : public c1 { }; class c3 : public c2 { }; Then c2 is

Direct base class of c3

Direct child class of c3

Direct base class of c1

None of these

 

 

Consider the code below, class class1{ private: int i; }; class class2 : public class1 { }; Then int member i of class1 is ______ in class2,

Public

Protected

Private

None of the given options

 

A parent class can call constructor of its child class through

Its constructor initialization list

Its constructor body

Both from its constructor initialization list or body

Can not call the constructor of its child class

 

In Private Inheritance the public members of base class become __________ in derived class.

Public

Private

Protected

None of the given options

 

Function overriding is done in context of,

Single class

Single derived class

Single base class

Derived and base classes

 

Child class can call constructor of its,

Direct base class

Indirect base class

Both direct and indirect base classes

None of these

 

Adding a derived class to a base class requires fundamental changes to the base class

True

False

 

_______________ is automatically called when the object is created.

Member function

Object

Constructor

None of the given

 

Inheritance is a way to

Organize data

Pass arguments to objects of classes

Add features to existing classes without rewriting them

Improved data-hiding and encapsulation

 

Through interface we access object_____________.

States

Data members

Behaviour

None of the given

 

 

Which of the following may not be integral part of an object?

State

Behavior

Protected data members

All of given

 

Suppose there is an object of type Person, which of the following can be considered as on of its attributes.

Name

Age

Work()

Both Name and Age

 

 

If we have an overloaded constrictor in our class, then compiler construct the default constructor.

True

False

 

Advantages(s) of information hiding

Simplifies the model

Restriction to change

Both of above

None of the above

 

If some of objects exhibit identical characteristics, then they belong to:

Different classes

Multiple classes

Same class

None of the given

 

Which of the following is the way to extract common behaviour and attributes from the given and make a separate class of those common behaviours and attributes?

Generalization

Sub-typing

Specification

Extension

 

 

A class has ________ destructor

One

Two

Three

 

Bahaviors of a type of objects are represented through

States

Attributes

Operations

 

Which is not an example of multiple inheritances?

Mermaid

Amphibious Vehicle

Car

None of the above

 

Static data members are called ____________ variable

Class

Object

Structure

None of the given

 

Associatively can be change in operator overloading.

True

False

 

 

________ and ______ methods may not be declared abstract.

Private,static

private,public

static,public

none of the given

 

 

Let Suppose a class Student with objects std1, std2, and std3. For the statement std3 =

std1 - std2 to work correctly, if the overloaded - operator must

take two arguments.

None of the given choices

take single argument

take three arguments

 

To initialize an array of objects, only _____________ will be called

Default Constructor

Overloaded Constructor

Default Object

None of the above

 

__________ provide the facility to access the data member.

accesser function

private function

inline function

None of the given

 

 

 

If a class involves dynamic memory allocation, then:

Default copy constructor, shallow copy is implemented

User defined copy constructor, shallow copy is implemented

Default copy constructor, deep copy is implemented

User defined copy constructor, deep copy is implemented

 

The sentence "Object Oriented Programming book in bookshelf" is an example of:

Association

Multiple associations

Aggregation

 

 

How the information hidden within an object can be accessed?

Through its interface

Through its private data member

Through its private member functions

 

 

There is no need to is or is a kind of relationship in generalization

True

False

 

An object has _______ interface(s)

Only one

Only two

One or more than one

 

Which of the following is an advantage of OOP?

It provides an ability to create one user defined data type extending the other

It provides the facility of defining abstract data type through which real entities can be defined better

All of the given option

 

Encapsulation means 
Select correct option: 

Extending the behaviour of class in another class
Data and behaviour are tightly coupled within an entity
One entity takes all the attributes and operations of the other
Taking out the common features and put those in a separate class

We can allocate dynamic memory allocation through___________ key word. 
Select correct option: 
Static
Global
New
Const

In programming, where the actual actions are coded is called: 
Select correct option: 

Function declaration
Function calling
Function definition
None of the given

Which of the following is directly related to polymorphism? 
Select correct option: 
Overriding
Const members
Static members
None of given

 

In a class declaration, data or functions designated private are accessible 
Select correct option: 
to any function in the program. 
only if you know the password. 
to member functions of that class. 
only to public members of the class. 

An instance of user defined type is called 
Select correct option: 

Object
Class
both of above
none of above

Aggregation is implemented using pointer. 
Select correct option: 
True
False

 

 

If class A supports all the operations of class B, then class A is:

Class A is behaviourally compatible with class B

Class A is behaviourally incompatible with class B

Class A is independent of class B

None of the given

 

 

 

Objects having identical characteristics belong to ______________

Same class

Two different classes

Any number of different classes

Objects can not have identical characteristics

 

 

 

 

 

 

 


--
--
Virtual University of Pakistan*** IT n CS Blog
================================
http://www.eNoxel.com
http://www.enoxelit.tk
http://www.geniusweb.tk
 
and Please do Share this group with your Friends and Class Fellows so that our Circle would expand and can be more useful for other Students.
 
Thanks, n Best of Luck......
 
 
You received this message because you are subscribed to the Google
Groups "vulms" group.
To post to this group, send email to vulmsit@googlegroups.com
To unsubscribe from this group, send email to
vulmsit+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/vulmsit?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups "vulms" group.
Visit this group at http://groups.google.com/group/vulmsit?hl=en-GB.
 
 

No comments:

Post a Comment