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.SwitchGoBreak
Stop Bit fields are a convenient way to express many difficult operations. However, bit fields suffer from one problem.
Lack of UsabilityLack of SecurityLack of PerformanceLack 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 integersAvoid memory leakagesAvoid memory overflow
Avoid syntax errors The order in which bytes of one word are stored is _________ dependent.
HardwareSoftwareLanguageSyntax 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 modifyMake the code difficult to modifyMake the code easy to understandDoes not effect understandability In the switch statement, cases should always end with a -------statement.
SwitchGoBreak
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 = falsex = NULLx = 0.0;
x = ‘\0’ using proper paranthesis normally makes the code.
easy to readeasy to understandless ambiguousAll 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.
TrueFalse 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 option
80/20 rule states that:
you spend 80 percent of your time in 20 percent of the codeyou 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 ________.
ObjectsClassesStructuresVariables 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)The C/C++ language has not specified whether ____ is arithmetic or logical.
Right shift >> Right shift << && || In order to make a code more portable, Instead of using vendor specific language extensions, use _______ as much as possible.
STL ANSI ISO CMMI The order in which bytes of one word are stored is _________ dependent.
hardware software language syntax
Be very careful when you use functions with side effects – functions that change the values of the ________.Objects Classes Structures Variables When a small set of functions (which use each other) is so overwhelmingly the bottleneck, there are two alternatives:
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
Loops (Not Sure)
Bugs in code
Sizes of data types
Conditional Structures
In the switch statement, cases should always end with a -------statment.
Switch
Go
Break
Stop
Some bit field members are stored: I) left to right II) right to left III) in circular array.
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 codeeasy 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.TrueFalse
Bit fields allow the packing of data in a structure. using Bit fields we can:Read 9 bit integers
avoid memory leakages
avoid memory overflowAvoid syntax errors
Be very careful when you use functions with side effects – functions that change the values of the ________.
ObjectsClassesStructuresVariables A test case involves
Input/output specification plus a statement of the function under testSteps 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.
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 ------------
Validated CorrectedCheckedTracedThe raising of the imaginary error flag is simply called raising or ________ an error.
CatchingCastingThrowing None of given optionsstruct packed_struct { unsigned int f1:1; } pack; Here in "packed_struct":
value of f1 = 1size of f1 = 1 bitvalue of f1 should not exceede 1None of given optionsThe idea behind exception handling is to raise some error flag every time ________.
The code compilesThe code linksMemory is allocatedSomething goes wrongBit fields allow the packing of data in a structure. using Bit fields we can:
Read 9 bit integersavoid memory leakages avoid memory overflowAvoid syntax errorsThe order in which bytes of one word are stored is _________ dependent.
hardwaresoftwarelanguagesyntaxA __________ is a variance from a desired product attribute.
ExceptionErrorMistakeDefect The C/C++ language does not define the alignment of items within.
structuresclassesunionsAll of the given options The raising of the imaginary error flag is simply called raising or ________ an error
CatchingCastingThrowing None of given options
Consider the following statement: int a,b=10; Which of the following is correct:variable "a" is initialized to 10Variable "b" is initialized to 10 Both variables "a" and "b" are initialized to 10variables can not be initialized this wayException handling is a powerful technique that separates error-handling code from ______ code.
NormalFaultyBuggyComplexBit fields are a convenient way to express many difficult operations. However, bit fields suffer from one problem.
Lack of usabilityLack of securityLack of performanceLack of portabilityThe complexity of a program may ______ if there are exceptional paths in it
DecreaseIncreaseRemain sameAll of given optionsWhen an error is thrown the overall system (on the lookout for this error flag) responds by ______ the error.
IgnoringCastingCatchingAll 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.
TrueFalse