Friday, January 13, 2012

vu.edu.pk[vueducation.com] CS504- Quiz No.3

CS504 - Software Engineering – I

Quiz No. 3

Dated 13-01-2012

Dear Students!

Be reminded that QUIZ-3 of CS504 has been launched. QUIZ will last till 11:59PM (13-Jan-2012) only and no alternate or offline will be provided once it is missed, so try to attempt QUIZ at your earliest.

Str  = 0;// str is string Which rewritten from of above line of code is more in line with the self-documentation philosophy than the code above.

Str = false;

Str = NULL;

Str = '\0;

Str = 0.0;

 

Struct packed_struct  { unsigned int f1:1;} pack; Here in "packed_struct":

Value of f1 =1

Size of f1 = 1 bit

Value of f1 should not exceede 1 (Not Sure)

None of given options

 

In the switch statement, cases should always end with a -------statment.

Switch

Go

Break

Stop

 

Bit fields are a convenient way to express many difficult operations. However, bit fields suffer from one problem

Lack of Usability

Lack of Security

Lack of Performance

Lack of Portability

 

If(!(block < activeBlock)) is equvivalent to:

If ((block < activeBlock))

If ((block == activeBlock))

If ((block >= activeBlock))

None of the given

 

Bit fields allow the packing of data in a structure. Using Bit fields we can:

Read 9 bit integers

Avoid memory leakages

Avoid memory overflow

Avoid syntax errors

 

The order in which bytes of one word are stored is _________ dependent

Hardware

Software

Language

Syntax

 

In order to write a portable code which of the following guideline will be helpful:

 

Stick to the standards

Program in the mainstream

Size of data types

All of give options

 

Complex expressions:

Make the code easy to modify

Make the code difficult to modify

Make the code easy to understand

Does not effect understandability

 

In the switch statement, cases should always end with a -------statment.

Switch

Go

Break

Stop

 

x = 0; // x is floating pt Which rewritten form of above line of code is more in line with the self-documentation philosophy than the code above.

x = false

x = NULL

x = 0.0;

x = '\0'

 

using proper paranthesis normally makes the code

easy to read

easy to understand

less ambiguous

All of the given options

 

The use of comments should be minimized by making the code self-documenting by appropriate name choices and an explicit logical structure.

True

False

 

Bit fields allow the packing of data in a structure. using Bit fields we can:

Read 9 bit integers

Avoid memory leakages

Avoid memory overflow

Avoid syntax errors

 

 

1) x = (a + 2 > 3)? a : a-1 ; 2) if((a + 2)> 3) x = a; else x = a - 1;

Statement (2) is more complex than (1)

Statement (2) is more complex than (1)

Both statements are very complex

None of the given options

 

80/20 rule states that:

you spend 80 percent of your time in 20 percent of the code
you spend 20 percent of your time in 80 percent of the code

We should try to optimized 80 percent or at least 20 percent of the code
None of the given options.

Be very careful when you use functions with side effects – functions that change the values of the ________

Objects

Classes

Structures

Variables

 

 

Comma ( , ) is very dangerous because 
Select correct option: 

Compiler does not recognise this symbol 
It creates linkage problem 
It causes side effects 
All of the given options (Not Sure)

The C/C++ language has not specified whether ____ is arithmetic or logical. 
Select correct option: 

Right shift >> 
Right shift << 
&& 
|| 

In order to make a code more portable, Instead of using vendor specific language extensions, use _______ as much as possible

Select correct option: 
STL 
ANSI 
ISO 
CMMI 


The order in which bytes of one word are stored is _________ dependent
Select correct option: 

hardware 
software 
language 
syntax 


Be very careful when you use functions with side effects – functions that change the values of the ________


Select correct option: 

Objects 
Classes 
Structures 
Variables 


When a small set of functions (which use each other) is so overwhelmingly the bottleneck, there are two alternatives: 
Select correct option: 

use a better algorithm OR re-write the code 
debug the code OR place assertions in code 
remove the functions OR add more functions 
changed programming language OR compiler at least 


_______ cause major portability issues 
Select correct option: 

Loops (Not Sure)
Bugs in code 
Sizes of data types 
Conditional Structures 

In the switch statement, cases should always end with a -------statment. 
Select correct option: 

Switch 
Go 
Break 
Stop 

Some bit field members are stored: I) left to right II) right to left III) in circular array 

Select correct option: 

only (I) is true 
Only (II) is true 
Both (I) and (II) are true 
All of the options (I, II and III) are true


x = 0; // x is floating pt Which rewritten form of above line of code is more in line with the self-documentation philosophy than the code above.

x = false

x = NULL

x = 0.0;

x = '\0'

 

 

Comma ( , ) is very dangerous because

Compiler does not recognise this symbol

It creates linkage problem

It causes side effects

All of the given options(Not sure)

 

using proper paranthesis normally makes the code

easy to read

easy to understand

less ambiguous

All of the given options

 

The use of comments should be minimized by making the code self-documenting by appropriate name choices and an explicit logical structure.

True

False

 

 

Bit fields allow the packing of data in a structure. using Bit fields we can:

Read 9 bit integers

avoid memory leakages

avoid memory overflow

Avoid syntax errors

 

1) x = (a + 2 > 3)? a : a-1 ; 2) if((a + 2)> 3) x = a; else x = a - 1;

Statement (2) is more complex than (1)

Statement (2) is more complex than (1)

Both statements are very complex

None of the given options

 

80/20 rule states that:

you spend 80 percent of your time in 20 percent of the code

you spend 20 percent of your time in 80 percent of the code

We should try to optimized 80 percent or at least 20 percent of the code

None of the given options.

 

Be very careful when you use functions with side effects – functions that change the values of the ________

Objects

Classes

Structures

Variables

 

A test case involves
Input/output specification plus a statement of the function under test
Steps to perform the function
Expected results that the software application produces
All of the given options

The C/C++ language has not specified whether ____ is arithmetic or logical. 

Select correct option:

Right shift >>

Right shift <<
&&
||


If an application fulfills its specifications but deviates from users expectations or their desired behavior. This means, software is verified but not ------------

Select correct option:

Validated

Corrected
Checked
Traced

The raising of the imaginary error flag is simply called raising or ________ an error
Select correct option:

Catching
Casting
Throwing
None of given options


In order to make a code more portable, Instead of using vendor specific language extensions, use _______ as much as possible
Select correct option:

STL
ANSI
ISO
CMMI

struct packed_struct { unsigned int f1:1; } pack; Here in "packed_struct":
Select correct option:

value of f1 = 1
size of f1 = 1 bit
value of f1 should not exceede 1
None of given options

The idea behind exception handling is to raise some error flag every time ________
Select correct option:

The code compiles
The code links
Memory is allocated
Something goes wrong



Bit fields allow the packing of data in a structure. using Bit fields we can:
Select correct option:

Read 9 bit integers
avoid memory leakages
avoid memory overflow
Avoid syntax errors

The order in which bytes of one word are stored is _________ dependent
Select correct option:

hardware

software
language
syntax

A __________ is a variance from a desired product attribute.
Select correct option:

Exception
Error
Mistake
Defect


The C/C++ language does not define the alignment of items within
Select correct option:

structures
classes
unions
All of the given options

The raising of the imaginary error flag is simply called raising or ________ an error
Select correct option:

Catching
Casting
Throwing
None of given options



Consider the following statement: int a,b=10; Which of the following is correct:
Select correct option:

variable "a" is initialized to 10
Variable "b" is initialized to 10
Both variables "a" and "b" are initialized to 10

variables can not be initialized this way

Exception handling is a powerful technique that separates error-handling code from ______ code.
Select correct option:

Normal
Faulty
Buggy
Complex

Bit fields are a convenient way to express many difficult operations. However, bit fields suffer from one problem
Select correct option:

Lack of usability
Lack of security
Lack of performance
Lack of portability


The complexity of a program may ______ if there are exceptional paths in it
Select correct option:

Decrease
Increase
Remain same

All of given options

80/20 rule states that:
Select correct option:
you spend 80 percent of your time in 20 percent of the code
you spend 20 percent of your time in 80 percent of the code

We should try to optimized 80 percent or at least 20 percent of the code
None of the given options.


When an error is thrown the overall system (on the lookout for this error flag) responds by ______ the error.
Select correct option:

Ignoring
Casting
Catching
All of the given options(Not Sure)

 

Comments are not syntax checked

TRUE

FALSE

 

Modularity is a tool that can help us in increasing the size of individual functions, making them less readable.

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

--
Group Owner: webmastarr@gmail.com
zainalizaini@gmail.com
 
Best Site All Over

www.vueducation.com is a platform where you can explore and enhance knowledge.

Community of VU Students just like a Family

No comments:

Post a Comment