In: Computer Science
1. True or False? If one programmer in a large team is given the task of writing a single function for the team project, this programmer is more likely to need a function driver than a function stub.
2. A(n) ____________________ is a dummy function that is included for testing the higher-level code.
3. ____________________ is the principle that a module should perform exactly one abstract action.
4.
For the function definition
int SomeFunc( /* in */ int alpha,
/* in */ int beta )
{
int gamma;
alpha = alpha + beta;
gamma = 2 * alpha;
return gamma;
}
what is the function postcondition?
a. // Postcondition: gamma == 2*alpha
b. // Postcondition: alpha == alpha@entry + beta
// && gamma == 2*alpha
c. // Postcondition: Function value == gamma
d. // Postcondition: Function value == 2*alpha
e. // Postcondition: Function value == 2*(alpha@entry + beta)
5. ____________________ is a measure of the quantity of information passing through a module's interface.
6. In contrast to promotion, ____________________ of data values can potentially cause loss of information.
7.
Using the library functions available through the header file cctype, which of the following can be used to determine if the variable someChar contains either a digit character or a lowercase letter?
a. if (isalnum(someChar) || isdigit(someChar))
b. if (isalpha(someChar) || isdigit(someChar))
c. if (isalnum(someChar) && !isupper(someChar))
d. if (islower(someChar) || isdigit(someChar))
e. c and d above
8. True or False? For team programming to succeed, it is essential that all of the module interfaces be defined explicitly and the coded modules adhere strictly to the specifications for those interfaces.
9.
Which of the following could cause an unexpected side effect?
a. modifying a global variable
b. changing the value of a value parameter
c. referencing a global constant
d. declaring an incoming-only parameter to be a reference parameter
e. a and d above
10. True or False? Unsigned types are most appropriate for advanced techniques that manipulate individual bits within memory within memory cells to avoid errors caused by, for example, using unsigned variables for ordinary numeric computations.
1.
If one programmer in a large team is given the task of writing a single function for the team project, this programmer is more likely to need a function driver than a function stub.
True
2.
Stub is a dummy function that is included for testing the higher-level code.
3.
Functional cohesion is the principle that a module should perform exactly one abstract action.
4.
int SomeFunc( /* in */ int alpha,
/* in */ int beta )
{
int gamma;
alpha = alpha + beta;
gamma = 2 * alpha;
return gamma;
}
// Postcondition: Function value == 2*(alpha@entry + beta)
Option e
5.
Communication complexity is a measure of the quantity of information passing through a module's interface.
6.
In contrast to promotion, demotion of data values can potentially cause loss of information.
7.
Using the library functions available through the header file cctype, which of the following can be used to determine if the variable someChar contains either a digit character or a lowercase letter.
if (isalnum(someChar) && !isupper(someChar))
if (islower(someChar) || isdigit(someChar))
Option e
8.
For team programming to succeed, it is essential that all of the module interfaces be defined explicitly and the coded modules adhere strictly to the specifications for those interfaces.
True
9.
Cause an unexpected side effect
modifying a global variable
declaring an incoming-only parameter to be a reference parameter
Option a and d
10.
Unsigned types are most appropriate for advanced techniques that manipulate individual bits within memory within memory cells to avoid errors caused by, for example, using unsigned variables for ordinary numeric computations.
True