What are the Precondition and Post condition statements for?
The Precondition and Post condition contracts as they are called in your text are instructions to the user. They delineate how each function is to be used. These contracts can also be used by the student as “work orders” if you will. They tell you, the student, what is required from each function. Usually, they will tell you what will be supplied by the driver program, and what will be returned to it. Additionally, they let you know some of the conditions to check for in data that is passed to your function. For example: If the Precondition states that the data passed to this function must be an greater than zero, you may wish to check this fact prior to working with it. One good way to do this is use the “assert ( )” function.