Algorithm:
Create two 2-dimensional arrays of String for boyNames and girlNames private static String[][] boyNames = new String[10][1000]; private static String[][] girlNames = new String[10][1000];
A method to read names For each year create the file name // for(int i=0; i<10;++i) Read each line Skip the ranking Read boy’s name Skip number of of boy’s name Read girl’s name Skip the number of girl’s name In main method readNames() Prompt the user for input Print the output