-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMusic.cpp
More file actions
60 lines (60 loc) · 1.64 KB
/
Music.cpp
File metadata and controls
60 lines (60 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#include<bits/stdc++.h>
using namespace std;
#include"MusicService.h"
int main()
{
MusicService musicService;
cout<<"Retrieving Music Catalog..."<<endl;
vector<string> musicCatalog=musicService.getMusicCatalog();
if(!musicCatalog.empty())
{
cout<<"Music Catalog retrieved successfully!"<<endl;
for(const auto&song:musicCatalog)
{
cout<<" - "<<song<<endl;
}
}
else
{
cout<<"Music Catalog is empty!"<<endl;
}
string playlistName="MyPlaylist",songToAdd="Song A";
cout<<"\nAdding "<<songToAdd<<" to playlist: "<<playlistName<<endl;
if(musicService.addSongToPlaylist(playlistName,songToAdd))
{
cout<<songToAdd<<" added to "<<playlistName<<" successfully!"<<endl;
}
else
{
cout<<"Failed to add "<<songToAdd<<" to "<<playlistName<<endl;
}
cout<<"\nRetrieving playlist: "<<playlistName<<endl;
vector<string> playlist=musicService.getPlaylist(playlistName);
if(!playlist.empty())
{
cout<<"Playlist retrieved successfully!"<<endl;
for(const auto&song:playlist)
{
cout<<" - "<<song<<endl;
}
}
else
{
cout<<"Playlist is empty or doesn't exist!"<<endl;
}
cout<<"\nGetting song recommendations..."<<endl;
vector<string> recommendations=musicService.getRecommendations();
if(!recommendations.empty())
{
cout<<"Recommendations retrieved successfully!"<<endl;
for(const auto&song:recommendations)
{
cout<<" - "<<song<<endl;
}
}
else
{
cout<<"No recommendations available!"<<endl;
}
return 0;
}