Completed Problem 10 (In Java...Also Not So Good)