Latest Activity In Study Groups

Join Your Study Groups

VU Past Papers, MCQs and More

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.

Assalm o Alikm
Share ur Quiz here and also giv corect answer of Ur Quiz
THnx

Views: 633

Replies to This Discussion

Please all students related this subject Share your online Quizzes here to help each other.thanks

 

Please share the question and their answers of this quiz if anyone has done.
Thanks. 

Question No.1 
Sender of the message does not need to know the exact class of receiver in______.
Please chose one
1) Abstraction
2) Polymorphism
3) Inheritance
4) none of the given
Answer: 2
Question No.2
Target of a _____ function call is determined at run time.
Please chose one
1) instance 
2) virtual 
3) operator 
4) none of given
Answer: 2
Question No.3 
A function call is resolved at run-time in_________ .
Please chose one
non-virtual member function
virtual member function
Both non-virtual member and virtual member function.
None of given
Answer: 3
Question No.4 
Consider the code below, class class1{ public: void func1(); }; class class2 : protected class1 { }; Function func1 of class1 is ____ in class2, 
Please chose one
public
protected
private
none of the given options
Answer: 2
Question No.5 
Consider the code below, class c1{ }; class c2 : public c1 { }; class c3 : public c2 { }; Then c2 is,
Please chose one
Direct base class of c3
Direct child class of c3
Direct base class of c1
None of these
Answer: 1
Question No.6 
A template provides a convenient way to make a family of.
Please chose one
1) variables and data members
2) functions and classes
3) classes and exceptions
4) programs and algorithms
Answer: 2
Question No.7 
Consider the code below, class c1{ }; class c2 : public c1 { }; class c3 : public c2 { }; Then c1 is,
Please chose one
Direct base class of c3
Direct child class of c3
Direct base class of c2
Direct child class of c2
Answer: 2
Question No.8 
User can make virtual table explicitly.
Please chose one
True
False
Answer: 1
Question No.9 
In type in depended function template should be use wherecode and behavior must be identical. 
Please chose one
True
False
Answer: 1

Question No.10 
Consider the code below, class class1{ protected: int i; }; class class2 : private class1 { }; Then int member i of class1 is ____ in class2, 
Please chose one
public
protected
private
none of the given options

Question # 1 of 10 ( Start time: 02:16:16 PM ) Total Marks: 1 
Friend Functions of a class are _________ members of that class. 
Select correct option: 

Public 
Private
Protected 
None of the given options.

Question # 2 of 10 ( Start time: 02:17:30 PM ) Total Marks: 1 
Consider the code below, class class1{ protected: int i; }; class class2 : protected class1 { }; Then int member i of class1 is ______ in class2, 
Select correct option: 

public 
protected 
private 
none of the given options 

Question # 3 of 10 ( Start time: 02:17:56 PM ) Total Marks: 1 
A Child class can call constructor of its parent class through, 
Select correct option: 

Its constructor initialization list 
Its constructor body 
Both from its constructor initialization list or body -
Can not call the constructor of its parent class 

Question # 4 of 10 ( Start time: 02:19:01 PM ) Total Marks: 1  We can access private members of the class from outside the class using ______ operator with its object pointer. 
Select correct option: 

-> 
. 
&
None of the given options


Question # 5 of 10 ( Start time: 02:20:13 PM ) Total Marks: 1 
A function call is resolved at run-time in___________ 
Select correct option: 

non-virtual member function 
virtual member function 
Both non-virtual member and virtual member function
None of given 

Question # 6 of 10 ( Start time: 02:20:35 PM ) Total Marks: 1 
It is sometimes useful to specify a class from which no objects will ever be created. 
Select correct option: 

True 
Flase 

Question # 7 of 10 ( Start time: 02:21:01 PM ) Total Marks: 1 
Consider the code below, class class1{ public: void func1(); }; class class2 : private class1 { }; Function func1 of class1 is ______ in class2, 
Select correct option: 

public 
protected 
private 
none of the given options

Question # 8 of 10 ( Start time: 02:21:26 PM ) Total Marks: 1 
Consider the code below, class class1{ public: int i; }; class class2 : protected class1 { }; Then int member i of class1 is ______ in class2, 
Select correct option: 

public
protected 
private 
none of the given options 

Question # 9 of 10 ( Start time: 02:22:00 PM ) Total Marks: 1 
Static casting is, 
Select correct option: 

Implicit way of calling base class functions from derived class

Explicit way of calling base class functions from derived class

None of these

Both of these

Question # 10 of 10 ( Start time: 02:23:15 PM ) Total Marks: 1 
Consider the code below, class class1{ protected: void func1(); }; class class2 : public class1 { }; Function func1 of class1 is ______ in class2, 
Select correct option: 

public 
protected

private 

none of the given options

In _______________ a pointer or reference to an object is created inside a class
Select correct option:

Aggregation 
Composition
Seperation
None of the given
Sub-Object can not be initialized using the constructor
Select correct option:

True
False

To initialize an array of objects, only _____________ will be called
Select correct option:

Defualt Constructor 
Overloaded Constructor
Default Object
None of the above

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
Select correct option:

take two arguments.
None of the given choices
take single argument
take three arguments

Copy constructor is called when:
Select correct option:

An object is created in term of pre existence object
An object is created 
An object is initialized
None of the given

Which of the following operator doesn’t take any argument if overloaded?
Select correct option:

/
-
+
None of the given choices

Object can be declared constant with the use of Constant keyword.
Select correct option:

True 
False

Always make pointer to null, whenever dynamic memory is deleted.
Select correct option:

True 
False

__________ provide the facility to access the data member.
Select correct option:

accesser function
private function
inline function
None of the given

Select correct line of code for inheritance relationship between “Gender” class and “Male” class. “Gender” is parent class while “Male” is child class.

Select correct option:

class Male: public Gender

class Gender: public Male

class Male:: public Gender

class Gender:: public Male

 

 

In______________, a pointer or reference to an object is created inside a class.

Select correct option:

Aggregation

Composition

Inheritance

Association

 

Select correct line of code for inheritance relationship between “Person” class and “Supervisor” class. “Person” is parent class while “Supervisor” is child class.

Select correct option:

class Supervisor: public Person

class Person: public Supervisor

class Supervisor:: public Person

class Person:: public Supervisor

 

 

The direction specifies which object contains the other object. In composition direction is must.

No

Yes

 

Select correct line of code for inheritance relationship between “Keys” class and “SpecialKeys” class. “Person” is parent class while “SpecialKeys” is child class.

Select correct option:

class SpecialKeys: public Keys

class Keys: public SpecialKeys

class SpecialKeys:: public Keys

class Keys:: public SpecialKeys

 

 

 

  

Keyboard” class is composed off “keys” class. What will be the order of execution of destructor of “Keyboard” class and “Keys” class?

Select correct option:

First Detructor::Keys..

Second Destructor::Keyboard..

First Destructor:: Keyboard..

Second Destructor:: Keys..

 

“A fan has wings”. Which type of relationship exists between fan and wings?

Aggregation

Association

Composition

Inheritance

 

What type of relationship exists between “Account” class and “SavingAccount” class?

Inheritance

Composition

Aggregation

Association

Select correct line of code for inheritance relationship between “Nationality” class and “Citizen” class. “Nationality” is parent class while “Citizen” is child class.

class Citizen: public Nationality

class Nationality: public Citizen

class Citizen:: public Nationality

class Nationality:: public Citizen

 Identify which of the following overloaded operator function's declaration is appropriate for the given call? Rational_number_1 + 2.325 Where Rational_number_1 is an object of user defined class Rational_number. 

Select correct option: 
Rational_number operator+( Rational_number & obj); 
None of the given choices 
Rational_number operator+(Rational_number &obj, double& num); 
operator+(double& obj); 


In _______________ a pointer or reference to an object is created inside a class 
Select correct option: 
Aggregation 
Composition 
Seperation 
None of the given


Sub-Object can not be initialized using the constructor 
Select correct option: 
True 
False 

To initialize an array of objects, only _____________ will be called 
Select correct option: 
Defualt Constructor 
Overloaded Constructor 
Default Object 
None of the above 

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 
Select correct option: 
take two arguments. 
None of the given choices 
take single argument 
take three arguments


Copy constructor is called when: 
Select correct option: 
An object is created in term of pre existence object 
An object is created 
An object is initialized 
None of the given 

Which of the following operator doesn't take any argument if overloaded? 
Select correct option: 



None of the given choices 


Object can be declared constant with the use of Constant keyword. 
Select correct option: 
True 
False 


Always make pointer to null, whenever dynamic memory is deleted. 
Select correct option: 
True 
False

__________ provide the facility to access the data member. 
Select correct option: 
accesser function 
private function 
inline function 
None of the given



Person” class is composed off “Nationality” class. What will be the order of execution of constructor of “Keyboard” class and “Keys” class
First Constructor:: Nationality..
Second Constructor:: Person..

First Constructor:: Person..
Second Constructor:: Nationality..


The direction specifies which object contains the other object. In aggregation direction is must
Yes
No


Select correct line of code for inheritance relationship between “Account” class and “SavingAccount” class. “Account” is parent class while “SavingAccount” is child clas

class SavingAccount : public Account
class Account: public SavingAccount
class SavingAccount :: public Account
class Account :: public SavingAccount

“Keyboard” class is composed off “keys” class. What will be the order of execution of destructor of “Keyboard” class and “Keys” class

First Detructor::Keys..
Second Destructor::Keyboard..
First Destructor:: Keyboard..
Second Destructor:: Keys..


Select correct line of code for inheritance relationship between “Keys” class and “StandardKeys” class. “Person” is parent class while “StandardKeys” is child class.

class StandardKeys: public Keys
class Keys: public StandardKeys
class StandardKeys:: public Keys
class Keys:: public StandardKeys

Select correct line of code for inheritance relationship between “Gender” class and “Male” class. “Gender” is parent class while “Male” is child class.
class Male: public Gender
class Gender: public Male
class Male:: public Gender
class Gender:: public Male

What will be most appropriate C++ data type for variable “InterestRate
Int
long int
double
float

Select correct line of code for composition relationship between “Keyboard” class and “Keys” class

class keyboard { Keys type;};
class keys{ KeyBoard type; };
class keyboard : private keys
class keys: private KeyBoard


Method “getInterestRate()” should belongs to class
Account()
SavingAccount()
CurrentAccount()
None of the given options

Can we access methods of composed object in the same way as we can access methods of other objects?
Yes
No

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

Composition

Aggregation

Seperation

non of the given

 

correct line of code for inheritance relationship between “Nationality” class and “Foreigner” class. “Nationality” is parent class while

“Foreigner” is child class.

class Foreigner: public Nationality

class Nationality: public Foreigner

class Foreigner:: public Nationality

 

Select correct line of code for aggregation relationship between “Person” class and “Phone” class.

class Person { Phone * p; };

class Phone { Person * p; };

class Person { Phone p; };

class Phone { Person p; };

In ______________destructor of sub-object is called after destructor of master class.

smilechat: options

Aggregation

Composition

Inheritance

Association

correct line of code for inheritance relationship between “Gender” class

and “Female” class. “Gender” is parent class while “Female” is child

class.

class Female: public Gender

class Gender: public Female

class Female:: public Gender

class Gender:: public Female

Account” is parent class while “CurrentAccount” is child class. Can I inherit the destructor of “account” class?

Yes

no

Select correct line of code for aggregation relationship between “Person” class and “Address” class.

class Person { Address * a; };

class Address { Person * a; };

class Person { Address a; };

class Address { Person a; };

In ______________constructors of the sub-objects are always executed before the constructors of the master class.

Select correct option:

Aggregation

Composition

Inheritance

Association

What will be most appropriate C++ data type for variable “MinimumBalance”?

Select correct option:

int

long int

float

double

Person” class is composed off “Nationality” class. What will be the order of execution of constructor of “Keyboard” class and “Keys” class
First Constructor:: Nationality..
Second Constructor:: Person..

First Constructor:: Person..
Second Constructor:: Nationality..

The direction specifies which object contains the other object. In aggregation direction is must
Yes
No

Select correct line of code for inheritance relationship between “Account” class and “SavingAccount” class. “Account” is parent class while “SavingAccount” is child clas
class SavingAccount : public Account
class Account: public SavingAccount
class SavingAccount :: public Account
class Account :: public SavingAccount


“Keyboard” class is composed off “keys” class. What will be the order of execution of destructor of “Keyboard” class and “Keys” class
First Detructor::Keys..
Second Destructor::Keyboard..

First Destructor:: Keyboard..
Second Destructor:: Keys..


Select correct line of code for inheritance relationship between “Keys” class and “StandardKeys” class. “Person” is parent class while “StandardKeys” is child class.

class StandardKeys: public Keys
class Keys: public StandardKeys
class StandardKeys:: public Keys
class Keys:: public StandardKeys

Select correct line of code for inheritance relationship between “Gender” class and “Male” class. “Gender” is parent class while “Male” is child class.
class Male: public Gender
class Gender: public Male
class Male:: public Gender
class Gender:: public Male


What will be most appropriate C++ data type for variable “InterestRate
Int
long int
double
float

Select correct line of code for composition relationship between “Keyboard” class and “Keys” class
class keyboard { Keys type;};
class keys{ KeyBoard type; };
class keyboard : private keys
class keys: private KeyBoard

Method “getInterestRate()” should belongs to class
Account()
SavingAccount()
CurrentAccount()
None of the given options

Can we access methods of composed object in the same way as we can access methods of other objects?
Yes
No

Identify which of the following overloaded operator function's declaration is appropriate for the given call? Rational_number_1 + 2.325 Where Rational_number_1 is an object of user defined class Rational_number.

Select correct option:

Rational_number operator+( Rational_number & obj);

None of the given choices

Rational_number operator+(Rational_number &obj, double& num);

operator+(double& obj);

 

In _______________ a pointer or reference to an object is created inside a class

Select correct option:

Aggregation

Composition

Seperation

None of the given

 

Sub-Object can not be initialized using the constructor

Select correct option:

True

False

 

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

Select correct option:

Defualt Constructor

Overloaded Constructor

Default Object

None of the above

 

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

Select correct option:

take two arguments.

None of the given choices

take single argument

take three arguments

 

Copy constructor is called when:

Select correct option:

An object is created in term of pre existence object

An object is created

An object is initialized

None of the given

 

Which of the following operator doesn't take any argument if overloaded?

Select correct option:

/

-

+

None of the given choices

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

Select correct option:

True

False

 

Always make pointer to null, whenever dynamic memory is deleted.

Select correct option:

True

False

__________ provide the facility to access the data member.

Select correct option:

accesser function

private function

inline function

None of the given

 

_____ is creating objects of one class inside another class.

Association

Composition

Aggregation

Inheritance

 

 

A template provides a convenient way to make a family of 
Select correct option: 
variables and data members 
functions and classes 
classes and exceptions 
programs and algorithms

 

A class template may inherit from another class template. 
Select correct option: 
True 
False

 

Target of a _____ function call is determined at run time. 
Select correct option: 
instance 
virtual 
operator 
none of given

 

A class hierarchy 
Select correct option: 
shows the same relationships as an organization chart. 
describes “has a” relationships. 
describes “is a kind of” relationships. 
shows the same relationships as a family tree.

 

Sender of the message does not need to know the exact class of receiver in______
Select correct option: 
Abstraction 
Polymorphism 
Inheritance 
none of the given

 

A function call is resolved at run-time in_________ 
Select correct option: 
non-virtual member function 
virtual member function 
Both non-virtual member and virtual member function. 
None of given

 

Adding a derived class to a base class requires fundamental changes to the base class. 
Select correct option: 
True 
False

 

 

User can make virtual table explicitly. 
Select correct option: 
True 
False

 

Binding means that target function for a call is selected at compile time. 
Select correct option: 
Static 
Dynamic 
Automatic 
None of given

 

Target of a _____ function call is determined at run time. 
Select correct option: 
instance 
virtual 
operator 
none of given

 

 

 

Which line will produce error. Class phone: private Transmit, private Receiver { } 1. int main() 2. { 3. phone obj; 4. Tranmit* obj1 = &obj; 5. Received obj2 = &obj; 6. } 
Select correct option: 
3rd line will produce error 
4th line will produce error 
3rd and 4th line will produce error. 
5th line will produce error

 

Function overriding is done in context of, 
Select correct option: 
Single class 
Single derived class 
Single base class 
Derived and base classes

 

Consider the code below, class class1{ public: void func1(); }; class class2 : protected class1 { }; Function func1 of class1 is ____ in class2, 
Select correct option: 
public 
protected 
private 
none of the given options

 

the following statements: 1) int iArray[5]; 2) int *pArr = iArray; 
Select correct option: 
These statements will compile successfully 
Error in first statement 
Error in second statement 
None of given options

Methodologies to the development of reusable software relate to________
Select correct option: 
Structure programming 
procedural programming 
generic programming 
None of the given

 

function template must have a parameter. 
Select correct option: 
True 
False

 

The default inheritance mode is, 
Select correct option: 
Public inheritance 
Protected inheritance 
Private inheritance 
None of these options

 

Two functions with same names, parameters and return type can exist in, 
Select correct option: 
Function overloading 
Function overriding 
Operator overloading 
None of these options

 

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

Direct base class of c3 
Direct child class of c3 
Direct base class of c1 
None of these

Virtual functions allow you to 
Select correct option: 
create an array of type pointer-to-base class that can hold pointers to derived classes. 
create functions that can never be accessed. 
group objects of different classes so they can all be accessed by the same function code. 
use the same function call to execute member functions of objects from different classes.

 

User can make virtual table explicitly. 
Select correct option: 
True 
False

 

In order to define a class template the first line of definition must be: 
Select correct option: 
template <typename T> 
typename <template T> 
Template Class <ClassName> 
Class <Template T>

 

Consider the following statements: 1) int iArray[5]; 2) int *pArr = iArray; 
Select correct option: 
These statements will compile successfully 
Error in first statement 
Error in second statement 
None of given options

+ Maryam Malik + Welcome 

thnx jnb

but Function template to in lecturs men he hi ni jin men se Quiz he

ye to lgta he koi old quiz paste kia gia he

Solved Today Quiz

Question # 1 of 10 ( Start time: 01:59:09 PM )
What will be most appropriate C++ data type for variable “InterestRate”?
Select correct option:
    int
    long int
    double
    =>float


Question # 2 of 10 ( Start time: 01:59:59 PM )
Select correct line of code for aggregation relationship between “Person” class and “Address” class.
Select correct option:

=>class Person { Address * a; };
class Address { Person * a; };
class Person { Address a; };
class Address { Person a; };


Question # 3 of 10 ( Start time: 02:01:24 PM )
__________is creating objects of one class inside another class.
Select correct option:
    Aggregation
    =>Composition
    Inheritance
    Association


Question # 4 of 10 ( Start time: 02:02:03 PM )
What type of relationship exists between “SavingAccount” class and “CurrentAccount” class?
Select correct option:
    Both are child classes
    Both contains each other
    =?Both are composed of each other
    None of the given option


Question # 5 of 10 ( Start time: 02:03:28 PM )
In ______________destructor of sub-object is called after destructor of master class.
Select correct option:
    Aggregation
    =>Composition
    Inheritance
    Association


Question # 6 of 10 ( Start time: 02:04:53 PM )
Select correct line of code for inheritance relationship between “Keys” class and “StandardKeys” class. “Keys” is parent class while “StandardKeys” is child class.
Select correct option:
    =>class StandardKeys: public Keys
    class Keys: public StandardKeys
    class StandardKeys:: public Keys
    class Keys:: public StandardKeys


Question # 7 of 10 ( Start time: 02:06:07 PM )
Select correct line of code for aggregation relationship between “Person” class and “Phone” class.
Select correct option:
    =>class Person { Phone * p; };
    class Phone { Person * p; };
    class Person { Phone p; };
    class Phone { Person p; };



Question # 8 of 10 ( Start time: 02:07:09 PM )
“Keyboard” class is composed off “keys” class. What will be the order of execution of destructor of “Keyboard” class and “Keys” class?
Select correct option:
    First Detructor::Keys.. Second Destructor::Keyboard..
    =>First Destructor:: Keyboard.. Second Destructor:: Keys..


Question # 9 of 10 ( Start time: 02:08:38 PM )
There is an object of type Person, which of the following can be considered as one of its attributes:
Select correct option:
    Name
    Workat()
    Age
    =>Both age and name


Question # 10 of 10 ( Start time: 02:09:27 PM )
Select correct line of code for composition relationship between “Keyboard” class and “Keys” class.
Select correct option:
    =>class keyboard { Keys type;};
    class keys{ KeyBoard type; };
    class keyboard : private keys
    class keys: private KeyBoard



thanks broth

MCS Welcome

RSS

© 2021   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service