Let's start with a simple example, computing the discount. The general rule can be stated as: ''If the amount is more than $1000.00, the discount is 5%'': |!-fitlibrary.eg.Discount-!| |''calculate''| |''$''||''discount''| |0.00||0.00| |1000.00||0.00| |1010.00||50.50| |1100.00||55.00| |1200.00||60.00| |2000.00||100.00| * We start with a table that identifies the domain. * The second table defines the calculation rules In the second table: * The first row simply specifies that we're defining calculations * The second row has the labels. The ''given'' label on the left of the empty column is the "$" amount. The ''expected'' label on the right of the empty column is "discount". * The third row, and thereafter, independently specify an example of the calculation rule * The third row specifies that if the "$" amount is 0.00, the expected "discount" is 0.00. * The 5th row specified that if the "$" amount is 1010.00, the expected "discount" is 55.00. In general: * There can be any number of ''given'' and ''expected'' columns * The values need not be numbers. Here's the corresponding DiscountCode.