package arrayoperations;
import java.util.Scanner;
public class ArrayOperations {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println("How many numbers do you want to enter?");
int num = input.nextInt();
int array[] = new int[num];
System.out.println("Enter the " + num + " numbers now.");
for (int i = 0 ; i < array.length; i++ ) {
array[i] = input.nextInt();
}
System.out.println("These are the numbers you have entered.");
printArray(array);
}
public static void printArray(int arr[]){
int n = arr.length;
for (int i = 0; i < n; i++) {
System.out.print(arr[i] + " ");
}
double option;
Scanner reader1 = new Scanner(System.in);
System.out.println("\nWhich action would you like to perform? \n1 for count, 2 for sum, 3 for average, 4 for min, 5 for max, or 6 for standard deviation: ");
option = reader1.nextDouble();
for(int i = 0; i < n; i++){
if(option == 1 ){
System.out.println("count");
} else if (option == 2){
System.out.println("sum");
} else if (option == 3){
System.out.println("average");
} else if (option == 4){
System.out.println("min");
} else if (option == 5){
System.out.println("max");
} else if (option == 6){
System.out.println("standard deviation");
} else {
System.out.println(option);
}
}
}
}