A. Radio station JAVA wants a class to keep track of recordings it plays. Create
ID: 3739154 • Letter: A
Question
A. Radio station JAVA wants a class to keep track of recordings it plays. Create a class named Recordingthat contains fields to hold methods for setting and getting a Recording's title, artist, and playing time in seconds. Save the file as Recording.java.
B. Write an 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 -- song title, artist, or playing time. Perform the requested sort procedure, and display the Recording objects. Save the file asRecordingSort.java.
Java Programming 8th Edition
Chapter 9 Exercise 3
***Please make sure files compile***
Explanation / Answer
public class Recording { private String title; private String artist; private int playingTime; public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getArtist() { return artist; } public void setArtist(String artist) { this.artist = artist; } public int getPlayingTime() { return playingTime; } public void setPlayingTime(int playingTime) { this.playingTime = playingTime; } }
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.