Answer the following statements true (T) or false (F)

1. A program should have all of its functions written before testing can begin.
2. Call-by-reference is restricted to void functions.
3. Names of parameters in functions, especially function prototypes, have no meaning,
and may be selected quite arbitrarily.
4. Suppose a programmer supplies the ampersand for call-by-reference in a prototype,
5. There is no problem with these two function definitions:
```
void func(int x){/*…*/}
int func(double x){/*…*/ return something_double;}
```


1. False.
Functions that call other functions can be tested independently of the
called functions by writing stub functions. Stub functions are very simple functions
that do nothing much more than sending just enough data to the caller to allow
testing..
2. False
There is no connection between the return mechanism and the parameter
passing mechanism.
3. True
Technically true, nevertheless for the following reasons, names should
be selected with care. (I accept an answer of false from a student who provides a good
explanation.)Functions should be self-contained modules that are designed separately
from the rest of the program. On large projects, different programmers may be
assigned to write of different functions. The programmer must choose meaningful
names else the fellow programmers will have more difficulty than necessary in
understanding the code. That several functions may have the same parameter names
is of no matter.
4. False
The compiler compiles what the programmer writes, not the intent.
5. True
C++ allows function name overloading. C++ distinguishes the function
by inferring a list of types from the argument list then matching this to lists of
parameter types for the specified function name. This ignores the issue of coercion
(automatic type conversions).

Computer Science & Information Technology

You might also like to view...

To record the starting address of each of its files, a portion of the disk’s first track is set aside to hold a(n) __________.

a. directory b. index c. boot record d. table

Computer Science & Information Technology

Write statements that perform the following one-dimensional-array operations:

a) Set the three elements of integer array counts to 0. b) Add 1 to each of the four elements of integer array bonus. c) Display the five values of integer array bestScores in column format.

Computer Science & Information Technology

When multiple fields are used to identify a record, it is called a(n) ________ key

A) natural B) composite C) artificial D) alternate

Computer Science & Information Technology

Increasing the ________ creates more distinct colors in the graphic

A) brightness B) color C) picture effects D) contrast

Computer Science & Information Technology