Java: I need help to get started on my programming assignment: Write a program that prompts a user to enter data for an array. T
I don't know how to write a code that will allow the user to input ANY primitive data type. I understand how to code the bottom half to for the getTotal, etc. I just need help with creating a code to get the input of ANY primitive data type. I know I will need to use the scanner class. Here is the whole assignment: Write a program that prompts a user to enter data for an array. The user should be able to input ANY primitive data type (int, float, double, long). The program should also have the following methods: • getTotal. This method should accept a one-dimensional array as its argument and return the total of the values in the array. • GetAverage. This method should accept a one-dimensional array as its argument and return the average of the values in the array. • GetHighest. This method should accept a one-dimensional array as its argument and return the highest of the values in the array. • GetLowest. This method should accept a one-dimensional array as its argument and return the lowest of the values in the array.