/*
	The program lets the user determine the size of the array
	Then it stores the employee's name and hours into the array
	Hence, we will output the name and hours
	Exception handling is also used here
	
 *
 */
 
 import java.util.*;
 
 public class EmployeeArray
 {
 	public static void main(String[] args)
	{
		Scanner key = new Scanner(System.in);
		
		int size;
		
		try
		{
			System.out.println("How many employees? ");
			size = key.nextInt();
			
			/*
				The size of an array must be known before an array is created
				Here we create an array to hold employee and their hours
			*
			*/
			
			String emp[] = new String[size];
			double hour[] = new double[size];
				
			/*
				Stores the name of the employees into the array
				
			*
			*/
			System.out.println("Enter the name of the employees: ");
			
			for(int i=0; i<emp.length; i++)
			{
				emp[i] = key.next();
			}
			
			/*
				Stores the hours of the employee into the array
			
			*
			*/
	
			System.out.println("Enter the hours of the employee");
			
			for(int j=0; j<hour.length; j++)
			{

				hour[j] = key.nextDouble();
			}
	
		/*
			Output the names and hours of the employee
			
		*
		*/
		
			for(int n=0; n<size; n++)
			{
				System.out.println(emp[n] + " works " + hour[n] + " hour/s ");
			}
		}
		catch(InputMismatchException e)
		{
			System.out.println("Invalid Inputs");
		}
	}
}