Question: In JAVA Please! Thank you 8 . 8 LAB * : Program: Playlist You will be building a linked list. Make sure to keep track
In JAVA Please!
Thank you
LAB: Program: Playlist
You will be building a linked list. Make sure to keep track of both the head and tail nodes.
Create two files to submit.
SongEntry.java Class declaration
Playlist.java Contains main method
Build the SongEntry class per the following specifications. Note: Some methods can initially be method stubs empty methods to be
completed in later steps.
Private fields
String uniqueID Initialized to "none" in default constructor
string songName Initialized to "none" in default constructor
string artistName Initialized to "none" in default constructor
int songLength Initialized to in default constructor
SongEntry nextNode Initialized to null in default constructor
Default constructor pt
Parameterized constructor pt
Public member methods
void insertAfterSongEntry currNode pt
void setNextSongEntry nextNode Mutator pt
String getIDAccessor
String getSongName Accessor
String getArtistName Accessor
int getSongLength Accessor
SongEntry getNext Accessor
void printPlaylistSongs
Ex of printPlaylistSongs output:
Unique ID: S
Song Name: Peg
Artist Name: Steely Dan
Song Length in seconds:
In main prompt the user for the title of the playlist. pt
Ex:
Enter playlist's title:
JAMZ
Implement the printMenu method. printMenu takes the playlist title as a parameter and outputs a menu of options to manipulate the
playlist. pt
Ex:
JAMZ PLAYLIST MENU
a Add song
d Remove song
c Change position of song
s Output songs by specific artist
t Output total time of playlist in seconds
Output full playlist
q Quit
Implement the executeMenu method that takes parameters: a character representing the user's choice, a playlist title, the head node
of a playlist, and a Scanner object. executeMenu performs the menu options described below according to the user's choice, and returns
the head node of the playlist. pt
In main call printMenu and prompt for the user's choice of menu options. Each option is represented by a single character.
If an invalid character is entered, continue to prompt for a valid choice. When a valid option is entered, execute the option by calling
executeMenu and overwrite the head of the playlist with the returned object. Then, print the menu, and prompt for a new option. Continue
until the user enters q Hint: Implement Quit before implementing other options. pt
JAMZ PLAYLIST MENU
a Add song
d Remove song
c Change position of song
s Output songs by specific artist
t Output total time of playlist in seconds
Output full playlist
q Quit
Choose an option:
Implement "Output full playlist" menu option in executeMenu If the list is empty, output: Playlist is empty pts
Ex:
JAMZ OUTPUT FULL PLAYLIST
Unique ID: SD
Song Name: Peg
Artist Name: Steely Dan
Song Length in seconds:
Unique ID: JJ
Song Name: All For You
Artist Name: Janet Jackson
Song Length in seconds:
Unique ID: J
Song Name: Canned Heat
Artist Name: Jamiroquai
Song Length in seconds:
Enter song's unique ID:
SD
Enter song's name:
Peg
Enter artist's name:
Steely Dan
Enter song's length in seconds:
Implement the "Remove song" menu option in executeMenu Prompt the user for the unique ID of the song to be removed. pts
Ex:
REMOVE SONG
Enter song's unique ID:
JJ
"All For You" removed.
Implement the "Change position of song" menu option in executeMenu Prompt the user for the current position of the song and the
desired new position. Valid new positions are n the number of nodes If the user enters a new position that is less than move the
node to the position the head If the user enters a new position greater than n move the node to position n the tail cases will be
tested:
Moving the head node pt
Moving the tail node pt
Moving a node to the head pt
Moving a node to the tail pt
Moving a node up the list pt
Moving a node down the list pt
Ex:
Implement the "Output songs by specific artist" menu option in executeMenu Prompt the user for the artist's name, and output the
node's information, starting with the node's current position. pt
Ex:
OUTPUT SONGS BY SPECIFIC ARTIST
Enter artist's name:
Janet Jackson
Unique ID: JJ
Song Name: All For You
Artist Name: Janet Jackson
Song Length in seconds:
Unique ID: JJ
Song Name: Black Eagle
Artist Name: Janet Jackson
Song Length in seconds:
Implement the "Output total time of playlist" menu option in executeMenu Output the sum of the time of the playlist's songs in
seconds pts
Ex:
OUTPUT TOTAL TIME OF PLAYLIST IN SECONDS
Total time: seconds
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
