Write a program to:
1. Read N(set max to 500) numbers from the keyboard(provide a method to end the input);
2. Ask the user of the program if the program should:
a. calculate the average of the numbers entered
or
b. calculate the sum of the numbers entered
3. Produce the result as the user instructed on the screen with appropriate messages
(Hint: repetitions,arrays,Functions must be used)