public class Main {

	static int[] nums;
	
	public static void main(String[] args) {
		
		//initialise the length of the array
		nums = new int[100];
		
		//put some data into the array
		populateArray();
		
		//display the contents of the array
		displayArray();
		
		//process the array and get the maximum value
		int max = getMaxVal();
		
		//display the current results
		if(max>100) {
			evacuate(max);
		}else if(max>50){
			shelter(max);
		}else {
			stayVigilant(max);
		}
	}
	
	public static void populateArray() {
		
		//populate each element in the array with a random number
		for(int i = 0; i<nums.length; i++) {
			nums[i] = (int)(Math.random()*100)+50;
		}
	}
	
	public static void getMaxVal() {
		
		//determine the max value in the array
		int max = 0;
		
		for(int i = 0; i<nums.length; i++) {
			if(nums[i]>max) {
				max = nums[i];
			}
		}
		
		return max;
		
	}
	
	public static void displayArray() {
		for(int i = 0; i<nums.length; i++) {
			System.out.println("Value "+(i+1)+: "+nums[i]);
		}
	}
	
	
	public static void evacuate(int num) {
		while(num>=0) {
			System.out.println(num+" : EVACUATE!!!");
			num--;
		}
	}
	
	public static void shelter(int num) {
		while(num>=0) {
			System.out.println(num+" : SHELTER!!!");
			num--;
		}
	}
	
	public static void stayVigilant(int num) {
		while(num>=0) {
			System.out.println(num + " : Stay vigilant!");
			num--;
		}
	}
	
	

}
