Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ PROGRAMMING: Write a program that manages songs playlists in media player applications. The program should allow typical media player functionalities such as playing the

C++ PROGRAMMING:

image text in transcribed

image text in transcribed

Write a program that manages songs playlists in media player applications. The program should allow typical media player functionalities such as playing the current song, previous song, next song, play the entire playlist, delete a song... To do that, the program creates a circular doubly linked list of Songs sorted by their names Each Song has two pointers to a Song, previous and next, and other private attributes as summarized below: string name; string artist; string genre; /l includes path // artist name genre of song double length; // length of song Song * previous; Song next; pointer to previous Song node /l pointer to next Song node The class SongPlayer has the following private attributes: Song * head; Song current; // pointer to list head pointer to current node being played. It is initialized to NULL lland is updated as new songs are played/deleted SongPlayer has at least one constructor, one destructor, and the following member functions: void addSong(string sName, string SArtist, string sGenre, double sLength) This function creates a new Song and initializes its data to sName, sArtist, sGenre, and sLength. The function then inserts the new Song into the list while maintaining the list order. A message must be displayed whether the song was either successfully added to the list or not void playSong(string sName) This function displays the details of the song whose name matches sName. Details include the number of the song in the playlist, the song name, the artist name, the genre and length. Make sure to include spaces when printing the song and artist names. You may assume that every new word starts with an uppercase. The number of the song is the number of the node. The function should also update the current pointer to point to this Song. If no such Song exists, an error message must be displayed void playCurrentSong0) This function displays the details of the current song, the song pointed to by the current pointer. void playNextSong0) Write a program that manages songs playlists in media player applications. The program should allow typical media player functionalities such as playing the current song, previous song, next song, play the entire playlist, delete a song... To do that, the program creates a circular doubly linked list of Songs sorted by their names Each Song has two pointers to a Song, previous and next, and other private attributes as summarized below: string name; string artist; string genre; /l includes path // artist name genre of song double length; // length of song Song * previous; Song next; pointer to previous Song node /l pointer to next Song node The class SongPlayer has the following private attributes: Song * head; Song current; // pointer to list head pointer to current node being played. It is initialized to NULL lland is updated as new songs are played/deleted SongPlayer has at least one constructor, one destructor, and the following member functions: void addSong(string sName, string SArtist, string sGenre, double sLength) This function creates a new Song and initializes its data to sName, sArtist, sGenre, and sLength. The function then inserts the new Song into the list while maintaining the list order. A message must be displayed whether the song was either successfully added to the list or not void playSong(string sName) This function displays the details of the song whose name matches sName. Details include the number of the song in the playlist, the song name, the artist name, the genre and length. Make sure to include spaces when printing the song and artist names. You may assume that every new word starts with an uppercase. The number of the song is the number of the node. The function should also update the current pointer to point to this Song. If no such Song exists, an error message must be displayed void playCurrentSong0) This function displays the details of the current song, the song pointed to by the current pointer. void playNextSong0)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatial Databases With Application To GIS

Authors: Philippe Rigaux, Michel Scholl, Agnès Voisard

1st Edition

1558605886, 978-1558605886

More Books

Students also viewed these Databases questions