finished code fro quiz2 in chapter2, named T2/mcmLength.java