Developing a correct algorithm can be a significant intellectual challenge. Flow charts which are the most widely used notations for developing algorithms were employed in the development of the two algorithms. This was done independent of the programming language that was used to implement them. Fig. 4 and fig. 5 outlines the two algorithms where the Stepwise Refinement Methodology was used to generate the pseudo-codes for both algorithms. The design of the algorithms considered the preciseness of the algorithms, the algorithms are executable, all possible circumstances are handled and termination of the algorithms. A discussion on the two algorithms is as follows