Counts number of times a digit appears

Assignment instructions: http://www.cs.duke.edu/csed/newapt/countappearances.html