Write a main method that asks the user for a non-negative integer n and returns the average of all the integers from 1 to n. Make sure that a possible division-by-zero exception is caught by an appropriate error message.
Reminder: to compute the average, you need to add up all the integers from 1 to n and then divide the resulting sum by n.
For extra credit: take care of the situation when a user accidentally types in a negative integer. Warning: extra credit will be only given if the main assignment works correctly.