Answers to Chapter 8 Review Questions ------------------------------------- 4. Changing the interface requires changing every program that depends on it, which can be very "time-consuming, error-prone activity". Doesn't mean you can't change how a specific function is implemented, or extend the interface. 5. Psuedo-random number is a random number that is generated by a deterministic algorithm; it is not truely random because it is impossible from a deterministic algorithm, but it is close enough to real random number that it is good enough. Pseudo-random numbers are: (1) statistically equivalent to true random numbers; and (2) very difficult to predict. 8. RandomInteger(1, 100) 10. No. The statement d1 = d2 = RandomInteger(1, 6); always assigns d1 and d2 the same value because the value assigned to d1 is always the result of the embedded assignment to d2. 12. #ifndef _magic_h #define _magic_h . . . contents of the interface . . . #endif These lines ensure that the compiler processes the contents of the interface only once, even if it is included several times. 13. True. Unless you take special steps to change the random number seed, the rand function generates the same sequence of pseudo-random numbers every time. 15. Take out the call to Randomize().