Question: Language is in C++ Given main(), complete the SongNode class to include the function PrintSonglnfo(). Then write the PrintPlaylist() function in main.cpp to print all
Language is in C++ 







Given main(), complete the SongNode class to include the function PrintSonglnfo(). Then write the PrintPlaylist() function in main.cpp to print all songs in the playlist. DO NOT print the dummy head node. Ex: If the input is: Stomp! 380 The Brothers Johnson The Dude 337 Quincy Jones You Don't Own Me 151 Lesley Gore -1 the output is: LIST OF SONGS Title: Stomp! Length: 380 Artist: The Brothers Johnson Title: The Dude Length: 337 Artist: Quincy Jones Title: You Don't Own Me Length: 151 Artist: Lesley Gore \#include iostream> \#include "SongNode.h" // TODO: Write PrintPlaylist() function int main() \{ SongNode* headNode; SongNode* currNode; SongNode* lastNode; string songTitle; string songLength; string songArtist; // Front of nodes list headNode = new SongNode(); lastNode = headNode; // Read user input until -1 entered getline(cin, songTitle); while (songTitle != "-1") \{ getline(cin, songLength); getline(cin, songArtist); currNode = new SongNode(songTitle, songLength, songArtist); Current file: SongNode.h Load default template... 26272829303132333435I/insertAftervoidInsertAfter(SongNode*nodeLoc);IIGetlocationpointedbynextNodeRefSongNode*GetNext();IIPrintssonginformationvoidPrintsongInfo();}; Current file: SongNode.cpp Load default template... II Get location pointed by nextNodeRef SongNode* SongNode: :GetNext () \{ return this->nextNodeRef; \} I/ TODO: Write PrintsongInfo() function
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
