RecordingSort.java (PLEASE HELP)
Question:
Radio station KJAVA wants a class to keep track of recordings it plays. Create a class named Recording that contains fields to hold methods for setting and getting a Recording’s title, artist, and playing time in seconds.
Implement the RecordingSort application that instantiates five Recording objects and prompts the user for values for the data fields. Then prompt the user to enter which field the Recordings should be sorted by—(S)ong title, (A)rtist, or playing (T)ime. Perform the requested sort procedure, and display the Recording objects.
The getter and setter methods for the song, artist, and playTime variables must be defined in the Recording class.
CODE:
Recording.java
public class Recording {
private String song;
private String artist;
private int playTime;
public void setSong(String title) {
}
public void setArtist(String name) {
}
public void setPlayTime(int time) {
}
public String getSong() {
}
public String getArtist() {
}
public int getPlayTime() {
}
}
RecordingSort.java:
import java.util.*;
public class RecordingSort {
public static void main(String[] args) {
// Write your code here
}
public static void sortByArtist(Recording[] array) {
// Write your code here
}
public static void sortBySong(Recording[] array) {
// Write your code here
}
public static void sortByTime(Recording[] array) {
// Write your code here
}
}