#include #include #include "song.h" using namespace std; class Cd { public: Cd (); // default constructor - empty CD Cd (bool fromUser, istream & strIn = cin); // get contents of CD from user or file Cd (const Cd & toCopy); // copy constructor Song ReturnNthSong(int n); Song ReturnRandomSong(); void PlayInOrder(); void PlayRandomOrder(); void PlayUserOrder(); int GetTotalTime(); // total time for all songs on the CD in seconds string GetTitle() const { return title; } string GetArtist() const { return artist; } int GetNumSongs() const { return allSongs.size(); } void SetTitle(const string & titl) { title = titl; return; } void SetArtist(const string & art) { artist = art; return; } private: void AddSong(const Song & newOne); // used by constructor list allSongs; string title; string artist; }; ostream & operator << (ostream & strOut, Cd & current); istream& mygetline(istream &strIn, string &newVal, char toStop = '\n'); // ask yes no question - not allowing to continue until y/Y/n/N entered // returns a lower case y or n (always! nothing else) char askYN (const string & prompt); // ask for a number within a range // not allowing an exit until a valid number is entered // Given: // the lowest valid value // the highest valid value // the prompt to ask the user (a string) double GetValid(double low, double high, string prompt); int GetValid(int low, int high, string prompt);