Changed methods and error messages

1. PMD error due to redundancy of error message because of consistency
of error messages idea. Changed to call a method to display the message
for consistency.

2. Changed method name of writeToFile to writeNames.

3. Changed writeFood method to transfer only the latest food information
to file instead of having to overwrite whole file.