We shall create two scripts in this recipe: the first one to establish the similarities between For and While, and another to lay the foundation to understanding the Do–While and Do–Until constructs. This way, the learning would be incremental, and understanding, easier.
For the first script, the scenario is the same as described in the last recipe, Using the For loop construct. For the second, the task is to take the year number as input and find the date for Mothers’ Day in that year.