import java.util.Scanner;

public class L13 {

	public static void main(String[] args) {

		Scanner kb = new Scanner(System.in);	

		int x = 5;
		x = 10;
		
		int[] arr = {1, 2, 3}; // arr is an array that holds 
								//the values 1, 2, and 3
		int length = arr.length;
		System.out.println("length: " + length);
		 
		int arr2[] = {4,5,6};

		int arr3[] = new int[10];  // arr3 holds 10 integer

		int first = arr[0];  // store in first the elm at index 0
		System.out.println("first in arr: " + first);

		arr[0] = 7;  // set element at index 0 to the value 7
		first = arr[0];  // store in first the elm at index 0
		System.out.println("first in arr: " + first);



		int len = arr3.length;
		for(int i = 0; i < len; i++) {
			System.out.println("element at " + i + ": " + arr3[i]);
		}

		// set all elements in the array to -5
		for(int i = 0; i < len; i++) {
			arr3[i] = -5;
		}

		for(int i = 0; i < len; i++) {
			System.out.println("element at " + i + ": " + arr3[i]);
		}

		// Set elements to 10 through 19
		for(int i = 0; i < len; i++) {
			arr3[i] = 10 + i;	
		}

		for(int i = 0; i < len; i++) {
			System.out.println("element at " + i + ": " + arr3[i]);
		}

		// Get 10 integers from the user and store in the array
		System.out.println("please enter 10 integers separated by spaces");
		for(int i = 0; i < len; i++) {
			arr3[i]	= kb.nextInt();
		}

		for(int i = 0; i < len; i++) {
			System.out.println("element at " + i + ": " + arr3[i]);
		}

		// Compute the mean of the values in arr3
		double sum = 0.0;
		for(int i = 0; i < len; i++) {
			sum = sum + arr3[i];
		}

		double mean = sum / arr3.length;
		System.out.println("mean: " + mean);

		int smallest = Integer.MAX_VALUE;
		for(int i = 0; i < len; i++) {
			if (arr3[i] < smallest) {
				smallest = arr3[i];
			}
		}
		System.out.println("smallest: " + smallest);

	} // End of main
} // End of class
