Your right, Rand really isn't neccessary, and I can remove the do while loop as well, but I think that having them in there helps connect the word problem with the code..after all once someone has thought the problem through enough to realise that the do while is not neccesary they don't need a demonstration program any more to prove it ;).