• A precondition is a condition that must be true before something is done
    • I must have money before I can deposit it into an account.
  • A postcondition is something that is true after an action is done.
    • My account will have greater value after I deposit my money
  • We want to describe any functions we write in terms of preconditions and postconditions.
  • We would also like to add comments to parameters telling us the way data is flowing
  • Example:
        void deposit_check(  /* in-out */ int& account_balence,
                             /* in */ int deposit_amount){
    
        // Preconditions:
        //     Both account_balence and deposit_ammount are initialized
        //     account_balence is set to the current balence
        //     deposit_amount holds an amount of money to deposit
        // Postconditions:
        //     account_balence is increased by deposit_amount
    
              account_balence += deposit_amount
        }