Question: #ifndef LOADEDSONGS _ H #define LOADEDSONGS _ H #include song.h class Playlist { private: Song * firstSong , * lastSong; int numberSongsLoaded; string name;

#ifndef LOADEDSONGS_H
#define LOADEDSONGS_H
#include "song.h"
class Playlist{
private:
Song *firstSong,*lastSong;
int numberSongsLoaded;
string name;
//have a private method to check if song is already in playlist
bool isSongInPlaylist(const Song& song)const;
//have a private method to add a new song to end of playlist (this gets called from the + operator overload)
void addSongToEnd(const Song& song);
//have a private method to delete song from end of list (this gets called from - operator overload)
void deleteSongFromEnd();
public:
//constructors and destructor
Playlist();
Playlist(const string& playlistname);
Playlist(const Playlist& rhs);
~Playlist();
//getters
string getName()const;
int getNumSongsLoaded()const;
//setters
void setName(const string& newName);
//adder for new song at specified index location
void addSongAt(int index, const Song& song);
//delete song from specific index location
void deleteSongAt(int index);
//method for getting a song at index
const Song* getSongAt(int index)const;
void displayLoadedSongs(bool=true)const;
Playlist& operator=(const Playlist& rhs);
friend ostream & operator <<(ostream &out, const Playlist &p);
void operator+(const Song& song);
void operator-(int index);
};
#endif

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!