Check10E (TS = 50)

Download the jar file typex.jar (the file has been updated on November 25, 22:30) and save it in the same directory as type.jar. typex.jar should already be part of your CLASSPATH.

Create the program named Check10E that prompts the user by printing

Enter the name of the iTunes library XML file: 
The file name should be entered on the same line (see sample run below). You may assume that the user always enters the name of an existing file. You may also assume that the file is an iTunes library XML file. A sample can be found here. Your program should print the names of all the tracks, that is, the name of each track of each playlist. However, each name should be printed only once. Furthermore, before each name you should print how often the track has been played (the counter and the name are separated by a tab). The tracks should be printed from most played to least played. In case of ties (that is, two or more track have been played the same number of times), the tracks should ordered using the lexicographic order (as used in a dictionary and a phone book).

Here is a sample run (where the user has entered library.xml)

Enter the name of the iTunes library XML file: library.xml
99      The Twist
87      Hotel California
75      Respect
27      Hey Jude
26      Imagine
19      Billie Jean
19      In the Ghetto

To check whether your code is correct, you can use eCheck. You are advised to use the offline mode first. Once your code is correct (worth 3 marks) and you are happy with your style (worth 2 marks), you can switch to the online mode and submit your solution. For style, you should adhere to the code conventions described in Appendix C of the textbook.