Answer the following questions true (T) or false (F)
1. 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.
2. A sequence of calls to the library function rand() generates mathematically correct random number sequences.
1. True
Explanation: 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.
2. False
Explanation: The sequence is called pseudorandom because it appears to be random. The results are good enough to obtain usable answers with computer simulation.
You might also like to view...
Which of the following will be true after these lines are executed?
Consider the following snippet of code: ``` Random generator = new Random(); int randNum = generator.nextInt(20) + 1; ``` a) randNum will hold a number between 1 and 20 inclusive. b) randNum will hold a number between 0 and 20 inclusive. c) randNum will hold a number between 1 and 21 inclusive. d) these lines will not be executed because a compiler error will result. e) none of the above
Write a method for Turtle to draw a pentagon. Pass in the length of the sides.
What will be an ideal response?
Both Dot and Mike need to know when new computers have been received. Create the NEW COMPUTER RECEIVED REPORT. The COMPUTER RECEIVED REPORT data flow contains the necessary elements.
What will be an ideal response?
The Password widget replaces displayed characters with bullets to keep the password private.
Answer the following statement true (T) or false (F)