QUESTION 5 The matric dance committee wants to use the songs…
QUESTION 5 The matric dance committee wants to use the songs with the most votes. They would also like to know how long the whole playlist would be. Code the following two methods to help them with this. 5.1. Create a method named sortSongs() in the AllSongs class. This method should sort the songs array (sArr). The songs should be ranked from those with the highest votes to those with the lowest. (7) 5.2. In the PlaylistUI class, add code in the correct place to sort the array before the playlist is displayed. (1) 5.3. Create a method called calcLength() in the appropriate class to determine the total length of the playlist. (6) 5.4. In the PlaylistUI class, add code to display the total length of the playlist with an appropriate message. (1) Question 5 Total: [15] Total: 125 marks
Read Details