Problem 13.10. Write a class called Alternate with methods to populate an integer array and then compute the alternating sum of all the elements in that array.
For example: if the elements are 1 4 9 16 9 7 4 9 11
then it computes
1–4+9–16+9–7+4–9+11 = -2
Test this class and print your final answer.