A method called forward(), presented above


Given the following pseudo code:
public void forward() {
if (state.equals("playing")) {
Mp3 song = songs.get(currentSongPlaying);
song.stop(); 
if (songs.size()-1>currentSongPlaying) {
currentSongPlaying = currentSongPlaying + 1;
song = songs.get(currentSongPlaying);
song.play(this);
} else if (songs.size()-1==currentSongPlaying) {
state="notPlaying";
}
Explain the function of each line of code to get a bird's-eye view of the method.
A method called forward(), presented above, deserves a companion method called backward() that allows users to move back to the previous song in the playlist. Create this method based upon the code for the forward() method. Annotate your code with comments. Use good coding practices, including naming standards and appropriate white space.

Request for Solution File

Ask an Expert for Answer!!
Programming Languages: A method called forward(), presented above
Reference No:- TGS086807

Expected delivery within 24 Hours