main.cpp: #include <iostream> #include <string> using namespace std; class SongNode { private: string songTitle; string songLength; string songArtist; SongNode* nextNodeRef; public: SongNode() { songTitle = ""; songLength = ""; songArtist = ""; nextNodeRef = NULL; } SongNode(string songTitleInit, string songLengthInit, string songArtistInit); SongNode(string songTitleInit, string songLengthInit, string songArtistInit, SongNode* nextLoc); void InsertAfter(SongNode* nodeLoc); SongNode* GetNext(); void PrintSongInfo(); }; SongNode::SongNode(string songTitleInit, string songLengthInit, string songArtistInit) { this->songTitle = songTitleInit; this->songLength = songLengthInit; this->songArtist = songArtistInit; this->nextNodeRef = NULL; } SongNode::SongNode(string songTitleInit, string songLengthInit, string songArtistInit, SongNode* nextLoc) { this->songTitle = songTitleInit; this->songLength = songLengthInit; this->songArtist = songArtistInit; this->nextNodeRef = nextLoc; } void SongNode::InsertAfter(SongNode* nodeLoc) { SongNode* tmpNext; tmpNext = this->nextNodeRef; this->nextNodeRef = nodeLoc; nodeLoc->nextNodeRef = tmpNext; } SongNode* SongNode::GetNext() { return this->nextNodeRef; } void SongNode::PrintSongInfo() { cout << "Title: " << this->songTitle << endl; cout << "Length: " << this->songLength << endl; cout << "Artist: " << this->songArtist << endl << endl; } void PrintPlaylist(SongNode *song) { song = song->GetNext(); while (song != NULL) { song->PrintSongInfo(); song = song->GetNext(); } } int main() { SongNode* headNode; SongNode* currNode; SongNode* lastNode; string songTitle; string songLength; string songArtist; headNode = new SongNode(); lastNode = headNode; getline(cin, songTitle); while (songTitle != "-1") { getline(cin, songLength); getline(cin, songArtist); currNode = new SongNode(songTitle, songLength, songArtist); lastNode->InsertAfter(currNode); lastNode = currNode; getline(cin, songTitle); } cout << "nLIST OF SONGS" << endl; cout << "-------------" << endl; PrintPlaylist(headNode); return 0; } SongNode.h: #include <iostream> #include <string> using namespace std; class SongNode { private: string songTitle; string songLength; string songArtist; SongNode* nextNodeRef; // Reference to the next node public: SongNode() { songTitle = ""; songLength = ""; songArtist = ""; nextNodeRef = NULL; } // Constructor SongNode(string songTitleInit, string songLengthInit, string songArtistInit); // Constructor SongNode(string songTitleInit, string songLengthInit, string songArtistInit, SongNode* nextLoc); // insertAfter void InsertAfter(SongNode* nodeLoc); // Get location pointed by nextNodeRef SongNode* GetNext(); // Prints song information void PrintSongInfo(); }; // SongNode.cpp // Constructor SongNode::SongNode(string songTitleInit, string songLengthInit, string songArtistInit) { this->songTitle = songTitleInit; this->songLength = songLengthInit; this->songArtist = songArtistInit; this->nextNodeRef = NULL; } // Constructor SongNode:.