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

1. Every programmer must know all the details of what that programmer's team mates
are doing in their projects to do the work assigned. Why?
2. Procedural abstraction involves information hiding in that only the 'contract' between
the programmer using the function (the client) and author of a function is known to
either.
3. Code after a return or a call to the exit function is executed will not be executed.
4. A sequence of calls to the library function rand() generates mathematically correct
random number sequences.
5. It is legal to replace the prototype
double totalCost(int numberParam, double priceParam);
with the more terse, alternate form
double totalCost(int, double);


1. False
Only the client programmer needs to know the use to which a function is
put. Only the author of the function needs to know the internals. The only thing these
two share is the contract or specification of the function.
2. True.
Under procedural abstraction, the author (or programmer) of a given
function should know about how the application programmer (or the client) will use
the function is IN the ‘contract.’ The contract is what the function is to do, and the
conditions set on the parameters to guarantee that the function can do IT. The author
should not need not know how the function is to be used by the client programmer.
The client programmer should know only only needs to know what the function does,
the requirements on the parameters, but not how the function carries out the task. This
way each can do his job independently of the other.
3. True.
Control returns to the caller if return is executed out of a called function, and returns to the operating system if return is executed out of main. If exit
is executed anywhere, the program is terminated and control is returned to the operating system.
4. False.
The sequence is called pseudorandom because it appears to be random.
The results are good enough to obtain usable answers with computer simulation.
5. True.
The alternate form applies only to function declarations. You will see
this form in manuals. It is possible to omit variable names that will not be used in
function definitions, but the text does not do this.

Computer Science & Information Technology

You might also like to view...

The following session can be used to perform the task.

What will be an ideal response?

Computer Science & Information Technology

Apply the looping rules to accomplish the specified processing. Assume that the value of the variable n is equal to zero as the loop begins.

Modify the infinite loop to make it terminate after one time through.

Computer Science & Information Technology

A(n) ________ file maintains the formatting of your file, regardless of what type of computer on which the file is open

A) DOCX B) XLSX C) PPTX D) PDF

Computer Science & Information Technology

What is a relationship between concepts?

A. inheritance B. dependence C. association D. relationship

Computer Science & Information Technology