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