Question

In: Computer Science

1. True or False? If one programmer in a large team is given the task of...

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.

Solutions

Expert Solution

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


Related Solutions

1. True or false? If a sample size is large, then the shape of a histogram...
1. True or false? If a sample size is large, then the shape of a histogram of the sample will be approximately normal, even if the population distribution is not normal. 2. True or false? If a sample size is large, then the shape of the sampling distribution of the average will be approximately normal, even if the population distribution is not normal. 3. True or false? A sample histogram will have a normal distribution if the sample size is...
A business that makes large donations to charities is socially responsible Select one: True False
A business that makes large donations to charities is socially responsible Select one: True False
True and False True/False Write True or False before the statement. 1. Gypsum is the brand...
True and False True/False Write True or False before the statement. 1. Gypsum is the brand name for sheetrock. 2. Coreboards and liner boards come in 2-foot widths. 3. Adhesives are not used for bonding gypsum board directly to supports. 4. Supplemental fasteners should be used with contact adhesives. 5. Gypsum panels are applied first to ceilings and then to the walls. 6. The floating angle method of drywall application omits fasteners in the corner intersection of the ceilings and...
The following statements are, given certain assumptions, either true, false, or partly true and partly false....
The following statements are, given certain assumptions, either true, false, or partly true and partly false. State which is the case and give your reasons. It is the accuracy of your reasons that principally determines your grade. 1. (5 points) Under Smith’s natural progress of opulence, the liberty of the towns causes the liberty and development of the country.
1)True or False: Ambiguity is a type of vagueness True False 2)True or False: When determining...
1)True or False: Ambiguity is a type of vagueness True False 2)True or False: When determining whether a report of an argument should be treated as an argument, it is important to consider the context in which the report is made. True True False 3) True or False: In a V argument with two premises, if one of the premises is false, then the argument is definitely weak True False 4) True or False: A report of an argument can...
(True and False) Circle the correct answers. (True or False)   A continuous metric is one derived...
(True and False) Circle the correct answers. (True or False)   A continuous metric is one derived by counting something. (True or False) Categorical data is nominal data. (True or False) The tracking signal is the MAD divided by the running sum or errors. ((True or False) Ordinal data are ranked according to some relationship to one another. (True or False) Observations that radically different than the rest are called outlaws. (True or False) The second quartile and median are the...
Answer the given statements as True or False. If the statement is false, correct it so...
Answer the given statements as True or False. If the statement is false, correct it so it becomes a true statement. 1. The neutral axis can be found at a distance ‘y’ (where y>0) from the centroidal axis of a member. 2. The centre of curvature can be found at a radial distance (rho) from the neutral axis of a member in pure bending. 3. When developing generalized equations for stress transformations, we must consider stresses on only the horizontal...
1- A blanket deed of trust covers a single large piece of land. true or false...
1- A blanket deed of trust covers a single large piece of land. true or false ? 2- The property is deeded to the state only after the owner's five-year redemption period has expired. True False 3-Acceleration clause permits a lender to charge a late fee for a tardy loan payment. True False 4-1st installment of property taxes is due April 1st. True False 5-Only general contractors and subcontractors may obtain mechanic's liens against the owner's property. True False 6-...
True or False 1. Job order costing is used by companies that make large or unique...
True or False 1. Job order costing is used by companies that make large or unique products. 2. In a job order costing system, product costs are traced to work cells or departments. 3. A process costing system is used by companies that manufacture large amounts of similar products or liquid products. 4. In a process costing system, product costs are traced to individual products. 5. A basic part of a job order costing system is the set of procedures...
True or False Questions: Determine if true or false. If false why? 1) Premature efforts to...
True or False Questions: Determine if true or false. If false why? 1) Premature efforts to treat problem behavior before determining its function can be inefficient, ineffective, and even harmful. 2) Research has found that functional analyses conducted in natural environments (e.g., classroom settings) often yield the same (or even clearer) results compared to those conducted in simulated settings. 3) Problem behavior can only be maintained by one function. Behaviors are not multi-functional. 4) Indirect functional assessment procedures are referred...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT