Updated Chapter 6, Programming Project 4 (to use while loop)