This example gives you the practical essence of the rule making process. This is our first step so we are not focusing on accuracy very much. I know, this is not the only way of solving this problem and this is not the most efficient way. There are also other efficient ways to implement the same problem, but I'm using this one because I felt this solution is the simplest one and easiest to understand.
This example can help you to understand how rules can be coded and, after getting the result of the first prototype, what next steps you can take to improve your output.
See the code snippet in Figure 7.11: