C not C++ This is a continuation of the code from this link
(5) Implement the “Add song” menu item. New additions are added to the end of the list. (2 pts)
Ex:
ADD SONG Enter song’s unique ID: SD123 Enter song’s name: Peg Enter artist’s name: Steely Dan Enter song’s length (in seconds): 237
(6) Implement the “Remove song” function. Prompt the user for the unique ID of the song to be removed.(4 pts)
Ex:
REMOVE SONG Enter song’s unique ID: JJ234 “All For You” removed
(7) Implement the “Change position of song” menu option. Prompt the user for the current position of the song and the desired new position. Valid new positions are 1 – n (the number of nodes). If the user enters a new position that is less than 1, move the node to the position 1 (the head). If the user enters a new position greater than n, move the node to position n (the tail). 6 cases will be tested:
Moving the head node (1 pt)
Moving the tail node (1 pt)
Moving a node to the head (1 pt)
Moving a node to the tail (1 pt)
Moving a node up the list (1 pt)
Moving a node down the list (1 pt)
Ex:
CHANGE POSITION OF SONG Enter song’s current position: 3 Enter new position for song: 2 “Canned Heat” moved to position 2
(8) Implement the “Output songs by specific artist” menu option. Prompt the user for the artist’s name, and output the node’s information, starting with the node’s current position. (2 pt)
Ex:
OUTPUT SONGS BY SPECIFIC ARTIST Enter artist’s name: Janet Jackson 2. Unique ID: JJ234 Song Name: All For You Artist Name: Janet Jackson Song Length (in seconds): 391 4. Unique ID: JJ456 Song Name: Black Eagle Artist Name: Janet Jackson Song Length (in seconds): 197
(9) Implement the “Output total time of playlist” menu option. Output the sum of the time of the playlist’s songs (in seconds). (2 pts)
Ex:
OUTPUT TOTAL TIME OF PLAYLIST (IN SECONDS)
The post Implement the “Add song” menu appeared first on My Assignment Online.