Wednesday, December 5, 2012

.::VULMSIT::.eNoxel.com CS304 Quiz No.2 Rescheduled Dated Dec 05, 2012

CS304 – Quiz No.2 ReScheduled

Dated 05-12-2012

 

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 of "keys" class. What will be the order of execution of constructor 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

 

Select correct line of code for inheritance relationship between "Nationality" class and "Foreigner" class. "Nationality" is parent class while "Foreigner" is child class.

"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. "Keys" 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

 

 



--
Zindagi mein 2 Logo ka buhat khayal rahkoooo
Ist woh jiss ney tumhari jeet ke Liye buhat kuch hara hoo
(Father)
2nd woh jiss ko tum ney har dukh me pukaara hoo (Mother)
Regards,
Umair Saulat Mc100403250

--
--
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.
 
 

.::VULMSIT::.eNoxel.com CS401 Quiz no.2 Dated DEC 05, 2012

CS401 Computer Architecture and Assembly Language 

Quiz No.2 May 02, 2012

 

 

Both DS and ES can be used to access the video memory. However we commonly keep DS for accessing our data, and load ES with the segment of video memory.
Select correct option:

True
False

PAGE 81

 

Question # 2 of 10 ( Start time: 03:17:23 PM ) Total Marks: 1
How many characters standard ASCII has?
Select correct option:

512
256   

128
64

 

 

During the CALL operation, the current value of the instruction pointer is automatically saved on the stack, and the destination of CALL is loaded in the instruction pointer.
Select correct option:

True
False

 

VGA stands for
Select correct option:

Video Graphic Accumulator  
Video Graphics Adapter
Visual Graphics Adapter
Video Graphics Application

 

Video Graphics Adapter

________ transfers the word at the current top of stack (pointed to by SP) to the destination operand and then increments SP by two to point to the new top of stack.
Select correct option:

PUSH
POP
CALL
None of the given

 

The execution of the instruction "mov word [ES : 160], 0x1230" will print a character on the screen at:
Select correct option:

First column of second row
Second column of first row
Second column of second row
First column of third row

 

 The Operation of pop ax is AX <-- [SP] SP <-- SP-2
Select correct option:

True
False

_______ function decrements SP (the stack pointer) by two and then transfers a word from the source operand to the top of stack now pointed to by SP.
Select correct option:

POP
PUSH
RET
ADD

 Far calls are called intra segment calls.
Select correct option:

True
False

 

STOS is often used to clear a block of memory or fill it with a constant.
Select correct option:

True   
False

How many characters were defined by standard ASCII?

Select correct option:

132

124

122

128

 

Stack clearing by the caller needs an extra instruction on behalf of the caller after every call made to the subroutine, unnecessarily increasing instructions in the program.
Select correct option:

True
False

 

 The direction of movement is controlled with the _________________in the flags register. If this flag is cleared the direction is from lower addresses towards higher addresses and if this flag is set the direction is from higher addresses to lower addresses.
Select correct option:

Direction Flag (DF)
Control Flag (CF)
Carry Flag (CF)
Non of above

 

ASCII stands for____________________________.
Select correct option:

American Standard Code for Information Interaction
American Standard Code for Information Interchange
American Standard Communication for Integer Interchange
American Scientific Communication for Integer Interaction

  During the CALL operation, the current value of the instruction pointer is automatically saved on the stack, and the destination of CALL is loaded in the instruction pointer.
Select correct option:

Extended ASCII has 256 characters with assigned numbers from
Select correct option:

1 to 255
0 to 256
0 to 255
1 to 256

 Hexadecimal is the prevalent and standard format for representation of characters in computers.
Select correct option:

True
False

 

The execution of the instruction "mov word [ES : 160], 0x1230" will print a character on the screen at:
Select correct option:

First column of second row
Second column of first row
Second column of second row
First column of third row

 

In the instruction "mov word [es:160], 0x1230", 12 means:
Select correct option:

green color on black background

green color on blue background
black color on green background
blue color on green background

 

 

This top of stack is contained in the ____ register.
Select correct option:

SP
BP
AX
BX

 

PUSH increments SP (the stack pointer) by two and then transfers a word from the source operand to the top of stack now pointed to by SP.
Select correct option:

True
False

Page  71

 

The reduction in code size and the improvement in speed are the two reasons why block processing instructions were introduced in the _____________ processor.
Select correct option:

8088
8085
8080
iAPX386

 

MOVS is used to ________ a block of memory.
Select correct option:

Save
Move
Delete
Push

 

The operation of PUSH is not similar to CALL however with a register other than the instruction pointer.
Select correct option:

True
False

Reference:  operation of PUSH is similar to CALL however with
a register other than the instruction pointer. page 69

 

Both DS and ES can be used to access the video memory. However we commonly keep DS for accessing our data, and load ES with the segment of video memory.
Select correct option:

True
False

 

 

Which bit of the attributes byte represents the blue component of foreground color ?
Select correct option:

0

1
2
3

 

SCAS compares a source byte or word in register AL or AX with the ___________ string element addressed by ES: DI and updates the flags.

Source

Destination

Flag

Register

page 92

 

An element is pushed on the stack SP is decremented by ____ as the 8088 stack works on word sized elements.

Three

two

four

five

page 68

 

To access the arguments from the stack, the immediate idea that strikes is to ____ them off the stack.

  push

  pop

  add

  insert

 

We use _______ to access the parameters that are stay on the stack with out popping them.

pop

DS not sure

PUSH

BP

 

How many characters were defined by standard ASCII?

132

124

128

 

ASCII table is the contiguous arrangement of the uppercase alphabets (41-5A), the lowercase alphabets (61-7A), and the numbers ______________

31-40

29-39

30-39

page no 80

 

The purpose of MOVS instruction is to move a memory location to register

True

False

_________ decrements SP (the stack pointer) by two and then transfers a word from the source operand to the top of stack now pointed to by SP.

push

pop

call

None

 

This top of stack is contained in the ____ register.

SP

BP

AX

 

To access the arguments from the stack, the immediate idea that strikes is to ____ them off the stack.
Select correct option:
Push
Pop
Add
Insert


Parameters clears from the stack by the
Select correct option:
caller
callee
caller and callee
None of the given



There are just ____ block processing instructions in 8088.
Select correct option:
6
5
4
3


_________ decrements SP (the stack pointer) by two and then transfers a word from the source operand to the top of stack now pointed to by SP.
Select correct option:
PUSH
POP
CALL
None of the Above



The operation of PUSH is not similar to CALL however with a register other than the instruction pointer.
Select correct option:
True
False


The direction of movement is controlled with the _________________in the flags register. If this flag is cleared the direction is from lower addresses towards higher addresses and if this flag is set the direction is from higher addresses to lower addresses.
Select correct option:
Direction Flag (DF)
Control Flag (CF)
Carry Flag (CF)
Non of above




Hexadecimal is the prevalent and standard format for representation of characters in computers.
Select correct option:
True
False

 

MUL (multiply) Instruction performs an unsigned multiplication of the source operand and the ___________.
Select correct option:
Accumulator
Carry
Word
Base



We can convert any digit to __ by adding 0x30 in the digit.
Select correct option:
Character
ASCII
EBCDIC
Standard Code

 

A typical stack is an area of computer memory with a fixed origin and a variable

True

False

 

Local variables should be created when the subroutine is called and discarded afterwards.

True

False

 

Both DS and ES can be used to access the video memory. However we commonly keep DS for accessing our data, and load ES with the segment of video memory.

True

False

 

 

Elements are removed from the stack in the reverse order to the order of their addition.

True

False

 

The Operation of Push is if "we push ax" then SP<-- SP+2 [SP]<-- AX

True

False

 

 

The operations of placing items on the stack and removing them from there are called push and ret.

True

False

 

A _____ is an area of memory that holds all local variables and parameters used by any function and remembers the order in which functions are called so that function returns occur correctly.

Instruction Pointer

Stack

Data Segment

Base Register

 

Stack is a data structure that behaves in a first in last _______ manner.

In

Out

Push

Add

 

RET do not pops the word at the top of the stack (pointed to by register SP) into the instruction pointer but increments SP by two.

True

False

 

 



--
Zindagi mein 2 Logo ka buhat khayal rahkoooo
Ist woh jiss ney tumhari jeet ke Liye buhat kuch hara hoo
(Father)
2nd woh jiss ko tum ney har dukh me pukaara hoo (Mother)
Regards,
Umair Saulat Mc100403250

--
--
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.