Completed Problem 9 (In Java...C++ Later)