Final answer:
To solve this problem, you can create a Java program named TheHill.java using Object Oriented Programming principles. The program should read the poem line by line and store each line in an ArrayList. You can then print the number of lines in the poem and process a specific number of lines chosen by the user.
Step-by-step explanation:
To solve this problem, you can create a Java program named TheHill.java that uses Object-Oriented Programming (OOP) principles. The program should include a FileDialog that allows the user to select the location of the poem file. After selecting the file, the program should read the poem line by line and store each line in an ArrayList<String>.
Once the poem is stored in the ArrayList, you can print the number of lines in the poem by using the size() method of the ArrayList. To process a specific number of lines chosen by the user, you can use a Scanner to get input from the user and then loop through the ArrayList to retrieve and process the desired number of lines.