
import java.io.*;

public class College
{
    public static void main (String args[]) throws IOException

    {
        //declare array
        String[] year;
        //create an array and initialise
        year = new String[] {"Freshman","Second Year","Junior","Senior"}; 
        
        System.out.println("The current available years are :");
        //assign a value to array element
        for (int i=0;i<year.length;i++)
        {
                System.out.println(i + " " +  year[i] + " ");
        }
        System.out.println("Please select a number for the year ");
        
        int yearnumber;
        String y=new String();
        // sets upo the Datainputstream to read in numbers
        DataInputStream in = new DataInputStream(System.in);
        
        //Clear the input stream
        System.out.flush();
        
        y = in.readLine(); // read in the users input
        
        //assign it to the yearnumber
        yearnumber = Integer.parseInt(y);
        
        System.out.println("You chose the year " + y + " which is the college year " + year[yearnumber] );

     }   
}//ends the main        
        
        
        
