double album_db::findAlbumPrice(int album_id) { for(int i=0;i<albums.size();i++) { Album temp = albums.at(i); if( temp.getAlbumID() == album_id ) return temp.getAlbumPrice(); } }
string album_db::findAlbumInfo(int album_id) { string name; double price; for(int i=0;i<albums.size();i++) { Album temp = albums.at(i); if( temp.getAlbumID() == album_id ) { name = temp.getAlbumName(); price = temp.getAlbumPrice(); break; } } std::ostringstream s; s << "Album\t" << name << "\t" << price; return s.str(); }