
class L33 {

	public static void main(String[] args) {
		System.out.println("hello world!");

		// Declare an array that holds the values 1-5.

		int[] arr = {1,2,3,4,5};

		// Declare an array that can hold 10 integers

		int[] arr1 = new int[10];

		/* populate arr1 with the values 1-10 */

		for(int i = 0; i < 10; i++) {
			arr1[i] = i + 1;
		}		

		/* print the contents of arr1 using the print method */

		print(arr1);

		/* compute the sum of 3 + 4 + 5 using the method add, and 
			print to the screen the result. */

		int sum = add(3,4,5);	
		System.out.println("sum: " + sum);

		System.out.println("sum: " + add(3,4,5));
		
		/* print the smallest value in arr1 using the min method */
		int smallest = min(arr1);
		System.out.println("smallest: " + smallest);

	}

	
	/* write a method named print that prints the contents
		of an integer array to the screen on a single line */

	static void print(int[] array) {
		for(int i = 0; i < array.length; i++) {
			System.out.print(array[i] + " ");
		}
		System.out.println();
	}

	/* write a method named add that takes 3 integers as arguments
		and returns their sum */


	static int add(int a, int b, int c) {
		int sum = a + b + c;
		return sum;
	}

	/* write a method named min that takes a array of integers as an argument
		and returns the smallest value in the array */

	static int min (int[] array) {
		int smallest = Integer.MAX_VALUE;;

		for(int i = 0; i < array.length; i++) {
			if(array[i] < smallest) {
				smallest = array[i];
			}
		}		

		return smallest;
	}




}
