Keep main() small and readable by writing functions that
are either modules or are for hiding details. main() should be a skeleton of the program
Write modules whenever possible.
Do not allow functions that are modules to be dependent upon
#defines. Pass values to these functions rather than using
symbolic constant names within the function's code.
See the changes made to GetRandomNumber() as an example.
GetRandomNumber() in lecture 4 relies upon #defines. (BAD!!!)
GetRandomNumber() in the Cards example below has the necessary
values passed in as arguments and is now independent code
(GOOD), which is essential for it to be a module.
Remove any large section of code that accomplishes one purpose
from main() and place it in an appropriately-named function
for hiding details.
Replace any numbers (constants) that "magically appear" in main()
and any "hiding-details" functions with symbolic constants
(meaningfully named #defines) for readability.