Completed excersise form section 7.6.  I have not read the chapter, just gave a shot to the problem. I know ++ is inefficient!