SlideShare a Scribd company logo
1 of 3
Download to read offline
Write a program in C++ language that implements a music player using Doubly Circular Linked
List using OOP concepts.
This assignment has four parts:
1- Write a class(new type) to define the Song type.
2- Implement the Doubly Circular Linked List, which will operate with Song type.
3- Implement the Music Player
4- Test it in the main function All Constructors should use the initializer list. 1. Song class
1- class song
#include <iostream>
using namespace std;
class Song{
private:
string songTitle;
string singerName;
public:
Song();
Song(string, string);
virtual ~Song();
string getSongTitle();
string getSingerName();
void setSongTitle(string);
void setSingerName(string);
friend ostream& operator<<(ostream& os, Song& p){
os << ": "<<"{"<<p.songTitle<<" : "<<p.singerName<<"}";
return os;
}
};
2- CNode class
#include <iostream>
#include "Song.h"
using namespace std;
class CNode{
private:
Song elem;
CNode *next;
CNode *prev;
friend class CircleDLinkedList;
};
3- CircleDLinkedList class
#include <iostream>
#include "CNode.h"
using namespace std;
class CircleDLinkedList{
private:
CNode* cursor;
int size;
public:
CircleDLinkedList();
~CircleDLinkedList();
bool empty();
void advance();
void add(Song &s);
void remove();
void print();
int getSize() const;
};
4- MusicPlayer class
#include <iostream>
#include "CircleDLinkedList.h"
using namespace std;
class MusicPlayer{
private:
string type; //will hold the type of the music player
int size; //the current number of the songs
CircleDLinkedList playerList; // list of the songs, CircleDLinkedList is the Doubly Circular Linked
List
public:
MusicPlayer(string);
virtual ~MusicPlayer();
void play(); //plays the current song, meaning that this method will print the properties of the Song
void next(); //moves to the net song and plays it
void previous(); ////moves to the previous song and plays it
void add (Song); //adds a song before the current song
void remove(); //removes the current song
void print(bool);//prints all songs that are in the list, starting from current to left is bool param is true
};
5- Test it in the main function
Create e musicplayer with 3 songs.
Play the current song.
Play the next song.
Play the next song.
Play the next song.
Play the previous song.
Print the list of the songs using bool parameter true.
Print the list of the songs using bool parameter false.
Remove the current song from the musicplayer.
Play the current song.
Play the next song.
Play the next song.
Play the next song.
Print the list of the songs using bool parameter true.
Print the list of the songs using bool parameter false.

More Related Content

Similar to Write a program in C++ language that implements a music play.pdf

Given main(), complete the SongNode class to include the printSong.pdf
Given main(), complete the SongNode class to include the printSong.pdfGiven main(), complete the SongNode class to include the printSong.pdf
Given main(), complete the SongNode class to include the printSong.pdfillyasraja7
 
8.8 Program Playlist (Java)You will be building a linked list. Ma.pdf
8.8 Program Playlist (Java)You will be building a linked list. Ma.pdf8.8 Program Playlist (Java)You will be building a linked list. Ma.pdf
8.8 Program Playlist (Java)You will be building a linked list. Ma.pdfARCHANASTOREKOTA
 
It's not working what am I doing wrong- Given main()- complete the Son.pdf
It's not working what am I doing wrong- Given main()- complete the Son.pdfIt's not working what am I doing wrong- Given main()- complete the Son.pdf
It's not working what am I doing wrong- Given main()- complete the Son.pdfaanyajoshi90
 
PLEASE I need help with my assignment I have to compelet .pdf
PLEASE I need help with my assignment I have to compelet  .pdfPLEASE I need help with my assignment I have to compelet  .pdf
PLEASE I need help with my assignment I have to compelet .pdfankit11134
 
In C++ please I need output please You will be building a .pdf
In C++ please I need output please   You will be building a .pdfIn C++ please I need output please   You will be building a .pdf
In C++ please I need output please You will be building a .pdfsunilverma8487
 
Exercise 3 You are to code some simple music player application .pdf
Exercise 3  You are to code some simple music player application .pdfExercise 3  You are to code some simple music player application .pdf
Exercise 3 You are to code some simple music player application .pdffacevenky
 
819 LAB Program Playlist c++ You will be building a li.pdf
819 LAB Program Playlist c++ You will be building a li.pdf819 LAB Program Playlist c++ You will be building a li.pdf
819 LAB Program Playlist c++ You will be building a li.pdfmeenaaarika
 
Many of us have large digital music collections that are not always .pdf
Many of us have large digital music collections that are not always .pdfMany of us have large digital music collections that are not always .pdf
Many of us have large digital music collections that are not always .pdffazanmobiles
 
Instructions This project focuses on queues and stacks Foll.pdf
Instructions This project focuses on queues and stacks Foll.pdfInstructions This project focuses on queues and stacks Foll.pdf
Instructions This project focuses on queues and stacks Foll.pdfadinathknit
 
Structuring Music Using Linked Lists
Structuring Music Using Linked ListsStructuring Music Using Linked Lists
Structuring Music Using Linked ListsCynthia Marcello
 
maincpp include ltiostreamgt include ltstringgt.pdf
maincpp  include ltiostreamgt include ltstringgt.pdfmaincpp  include ltiostreamgt include ltstringgt.pdf
maincpp include ltiostreamgt include ltstringgt.pdfmukulsingh0025
 
The provided codetrack_file_handling.rb class Track att.pdf
The provided codetrack_file_handling.rb class Track    att.pdfThe provided codetrack_file_handling.rb class Track    att.pdf
The provided codetrack_file_handling.rb class Track att.pdffashination
 
In C++ Plz LAB- Playlist (output linked list) Given main()- complete.pdf
In C++ Plz  LAB- Playlist (output linked list) Given main()- complete.pdfIn C++ Plz  LAB- Playlist (output linked list) Given main()- complete.pdf
In C++ Plz LAB- Playlist (output linked list) Given main()- complete.pdfshreeaadithyaacellso
 
In C++ Plz and In What Order Do I Put It In- LAB- Playlist (output li.pdf
In C++ Plz and In What Order Do I Put It In-  LAB- Playlist (output li.pdfIn C++ Plz and In What Order Do I Put It In-  LAB- Playlist (output li.pdf
In C++ Plz and In What Order Do I Put It In- LAB- Playlist (output li.pdfshreeaadithyaacellso
 
Hi,Please find the Ansswer below.PLAYLIST.h#include iostrea.pdf
Hi,Please find the Ansswer below.PLAYLIST.h#include iostrea.pdfHi,Please find the Ansswer below.PLAYLIST.h#include iostrea.pdf
Hi,Please find the Ansswer below.PLAYLIST.h#include iostrea.pdfapleathers
 
I am having the below compile errors. .pdf
I am having the below compile errors. .pdfI am having the below compile errors. .pdf
I am having the below compile errors. .pdfdbrienmhompsonkath75
 
C++ Programming Search A Linked ListThe Content of songlist.txt.pdf
C++ Programming Search A Linked ListThe Content of songlist.txt.pdfC++ Programming Search A Linked ListThe Content of songlist.txt.pdf
C++ Programming Search A Linked ListThe Content of songlist.txt.pdfherminaherman
 
You are required to implement all the classes as specified by UML di.pdf
You are required to implement all the classes as specified by UML di.pdfYou are required to implement all the classes as specified by UML di.pdf
You are required to implement all the classes as specified by UML di.pdfarorasales234
 

Similar to Write a program in C++ language that implements a music play.pdf (19)

Given main(), complete the SongNode class to include the printSong.pdf
Given main(), complete the SongNode class to include the printSong.pdfGiven main(), complete the SongNode class to include the printSong.pdf
Given main(), complete the SongNode class to include the printSong.pdf
 
8.8 Program Playlist (Java)You will be building a linked list. Ma.pdf
8.8 Program Playlist (Java)You will be building a linked list. Ma.pdf8.8 Program Playlist (Java)You will be building a linked list. Ma.pdf
8.8 Program Playlist (Java)You will be building a linked list. Ma.pdf
 
It's not working what am I doing wrong- Given main()- complete the Son.pdf
It's not working what am I doing wrong- Given main()- complete the Son.pdfIt's not working what am I doing wrong- Given main()- complete the Son.pdf
It's not working what am I doing wrong- Given main()- complete the Son.pdf
 
PLEASE I need help with my assignment I have to compelet .pdf
PLEASE I need help with my assignment I have to compelet  .pdfPLEASE I need help with my assignment I have to compelet  .pdf
PLEASE I need help with my assignment I have to compelet .pdf
 
In C++ please I need output please You will be building a .pdf
In C++ please I need output please   You will be building a .pdfIn C++ please I need output please   You will be building a .pdf
In C++ please I need output please You will be building a .pdf
 
Exercise 3 You are to code some simple music player application .pdf
Exercise 3  You are to code some simple music player application .pdfExercise 3  You are to code some simple music player application .pdf
Exercise 3 You are to code some simple music player application .pdf
 
819 LAB Program Playlist c++ You will be building a li.pdf
819 LAB Program Playlist c++ You will be building a li.pdf819 LAB Program Playlist c++ You will be building a li.pdf
819 LAB Program Playlist c++ You will be building a li.pdf
 
Many of us have large digital music collections that are not always .pdf
Many of us have large digital music collections that are not always .pdfMany of us have large digital music collections that are not always .pdf
Many of us have large digital music collections that are not always .pdf
 
Instructions This project focuses on queues and stacks Foll.pdf
Instructions This project focuses on queues and stacks Foll.pdfInstructions This project focuses on queues and stacks Foll.pdf
Instructions This project focuses on queues and stacks Foll.pdf
 
Structuring Music Using Linked Lists
Structuring Music Using Linked ListsStructuring Music Using Linked Lists
Structuring Music Using Linked Lists
 
maincpp include ltiostreamgt include ltstringgt.pdf
maincpp  include ltiostreamgt include ltstringgt.pdfmaincpp  include ltiostreamgt include ltstringgt.pdf
maincpp include ltiostreamgt include ltstringgt.pdf
 
Hsjs.pdf
Hsjs.pdfHsjs.pdf
Hsjs.pdf
 
The provided codetrack_file_handling.rb class Track att.pdf
The provided codetrack_file_handling.rb class Track    att.pdfThe provided codetrack_file_handling.rb class Track    att.pdf
The provided codetrack_file_handling.rb class Track att.pdf
 
In C++ Plz LAB- Playlist (output linked list) Given main()- complete.pdf
In C++ Plz  LAB- Playlist (output linked list) Given main()- complete.pdfIn C++ Plz  LAB- Playlist (output linked list) Given main()- complete.pdf
In C++ Plz LAB- Playlist (output linked list) Given main()- complete.pdf
 
In C++ Plz and In What Order Do I Put It In- LAB- Playlist (output li.pdf
In C++ Plz and In What Order Do I Put It In-  LAB- Playlist (output li.pdfIn C++ Plz and In What Order Do I Put It In-  LAB- Playlist (output li.pdf
In C++ Plz and In What Order Do I Put It In- LAB- Playlist (output li.pdf
 
Hi,Please find the Ansswer below.PLAYLIST.h#include iostrea.pdf
Hi,Please find the Ansswer below.PLAYLIST.h#include iostrea.pdfHi,Please find the Ansswer below.PLAYLIST.h#include iostrea.pdf
Hi,Please find the Ansswer below.PLAYLIST.h#include iostrea.pdf
 
I am having the below compile errors. .pdf
I am having the below compile errors. .pdfI am having the below compile errors. .pdf
I am having the below compile errors. .pdf
 
C++ Programming Search A Linked ListThe Content of songlist.txt.pdf
C++ Programming Search A Linked ListThe Content of songlist.txt.pdfC++ Programming Search A Linked ListThe Content of songlist.txt.pdf
C++ Programming Search A Linked ListThe Content of songlist.txt.pdf
 
You are required to implement all the classes as specified by UML di.pdf
You are required to implement all the classes as specified by UML di.pdfYou are required to implement all the classes as specified by UML di.pdf
You are required to implement all the classes as specified by UML di.pdf
 

More from iconsystemsslm

People with a latent TB infection are _____ asymptomatic an.pdf
People with a latent TB infection are _____ asymptomatic an.pdfPeople with a latent TB infection are _____ asymptomatic an.pdf
People with a latent TB infection are _____ asymptomatic an.pdficonsystemsslm
 
Writing a Concise Paper Cost Accounting Analysis Use Acti.pdf
Writing a Concise Paper  Cost Accounting Analysis Use Acti.pdfWriting a Concise Paper  Cost Accounting Analysis Use Acti.pdf
Writing a Concise Paper Cost Accounting Analysis Use Acti.pdficonsystemsslm
 
Working with the Calculator program Once imported run the.pdf
Working with the Calculator program Once imported  run the.pdfWorking with the Calculator program Once imported  run the.pdf
Working with the Calculator program Once imported run the.pdficonsystemsslm
 
When is it appropriate to use an independent pooled sample.pdf
When is it appropriate to use an independent pooled sample.pdfWhen is it appropriate to use an independent pooled sample.pdf
When is it appropriate to use an independent pooled sample.pdficonsystemsslm
 
TRUE OR FALSE QUESTIONS 1 In the communicable disease model.pdf
TRUE OR FALSE QUESTIONS 1 In the communicable disease model.pdfTRUE OR FALSE QUESTIONS 1 In the communicable disease model.pdf
TRUE OR FALSE QUESTIONS 1 In the communicable disease model.pdficonsystemsslm
 
Tengo tanto sueo pueden ayudarme Tengo mucho trabajo que.pdf
Tengo tanto sueo pueden ayudarme Tengo mucho trabajo que.pdfTengo tanto sueo pueden ayudarme Tengo mucho trabajo que.pdf
Tengo tanto sueo pueden ayudarme Tengo mucho trabajo que.pdficonsystemsslm
 
Soru 11 in ve Hindistann neden bu kadar ok uluslararas i.pdf
Soru 11  in ve Hindistann neden bu kadar ok uluslararas i.pdfSoru 11  in ve Hindistann neden bu kadar ok uluslararas i.pdf
Soru 11 in ve Hindistann neden bu kadar ok uluslararas i.pdficonsystemsslm
 
Setting up Webserver setting up webserver and running on t.pdf
Setting up Webserver  setting up webserver and running on t.pdfSetting up Webserver  setting up webserver and running on t.pdf
Setting up Webserver setting up webserver and running on t.pdficonsystemsslm
 
Robin has just been hired as a security engineer and wants t.pdf
Robin has just been hired as a security engineer and wants t.pdfRobin has just been hired as a security engineer and wants t.pdf
Robin has just been hired as a security engineer and wants t.pdficonsystemsslm
 
Redgreen colorblindness is due to a recessive Xlinked alle.pdf
Redgreen colorblindness is due to a recessive Xlinked alle.pdfRedgreen colorblindness is due to a recessive Xlinked alle.pdf
Redgreen colorblindness is due to a recessive Xlinked alle.pdficonsystemsslm
 
Required information P25 Algo Recording Transactions Pre.pdf
Required information P25 Algo Recording Transactions Pre.pdfRequired information P25 Algo Recording Transactions Pre.pdf
Required information P25 Algo Recording Transactions Pre.pdficonsystemsslm
 
QYESTIONS 1 Why was Dakotas existing pricing system inad.pdf
QYESTIONS  1 Why was Dakotas existing pricing system inad.pdfQYESTIONS  1 Why was Dakotas existing pricing system inad.pdf
QYESTIONS 1 Why was Dakotas existing pricing system inad.pdficonsystemsslm
 
Qu formas de vida crean nueva biomasa a travs de la produ.pdf
Qu formas de vida crean nueva biomasa a travs de la produ.pdfQu formas de vida crean nueva biomasa a travs de la produ.pdf
Qu formas de vida crean nueva biomasa a travs de la produ.pdficonsystemsslm
 
Q1 Reminder the arrows are going from who is being eaten t.pdf
Q1 Reminder the arrows are going from who is being eaten t.pdfQ1 Reminder the arrows are going from who is being eaten t.pdf
Q1 Reminder the arrows are going from who is being eaten t.pdficonsystemsslm
 
Oriole Corp uses a periodic inventory system A physical co.pdf
Oriole Corp uses a periodic inventory system A physical co.pdfOriole Corp uses a periodic inventory system A physical co.pdf
Oriole Corp uses a periodic inventory system A physical co.pdficonsystemsslm
 
PREGUNTA 19 A Aumentar su comerciabilidad B Increment.pdf
PREGUNTA 19  A  Aumentar su comerciabilidad  B  Increment.pdfPREGUNTA 19  A  Aumentar su comerciabilidad  B  Increment.pdf
PREGUNTA 19 A Aumentar su comerciabilidad B Increment.pdficonsystemsslm
 
Mira el anuncio de Disney Cruise Line Little Souvenir 00.pdf
Mira el anuncio de Disney Cruise Line Little Souvenir  00.pdfMira el anuncio de Disney Cruise Line Little Souvenir  00.pdf
Mira el anuncio de Disney Cruise Line Little Souvenir 00.pdficonsystemsslm
 
include ltinitializer_listgt include ltiostreamgt .pdf
include ltinitializer_listgt include ltiostreamgt .pdfinclude ltinitializer_listgt include ltiostreamgt .pdf
include ltinitializer_listgt include ltiostreamgt .pdficonsystemsslm
 
Annie wants to retain her skilled employees but she also do.pdf
Annie wants to retain her skilled employees but she also do.pdfAnnie wants to retain her skilled employees but she also do.pdf
Annie wants to retain her skilled employees but she also do.pdficonsystemsslm
 
Header files used to run the program include ltstdioh.pdf
Header files used to run the program  include ltstdioh.pdfHeader files used to run the program  include ltstdioh.pdf
Header files used to run the program include ltstdioh.pdficonsystemsslm
 

More from iconsystemsslm (20)

People with a latent TB infection are _____ asymptomatic an.pdf
People with a latent TB infection are _____ asymptomatic an.pdfPeople with a latent TB infection are _____ asymptomatic an.pdf
People with a latent TB infection are _____ asymptomatic an.pdf
 
Writing a Concise Paper Cost Accounting Analysis Use Acti.pdf
Writing a Concise Paper  Cost Accounting Analysis Use Acti.pdfWriting a Concise Paper  Cost Accounting Analysis Use Acti.pdf
Writing a Concise Paper Cost Accounting Analysis Use Acti.pdf
 
Working with the Calculator program Once imported run the.pdf
Working with the Calculator program Once imported  run the.pdfWorking with the Calculator program Once imported  run the.pdf
Working with the Calculator program Once imported run the.pdf
 
When is it appropriate to use an independent pooled sample.pdf
When is it appropriate to use an independent pooled sample.pdfWhen is it appropriate to use an independent pooled sample.pdf
When is it appropriate to use an independent pooled sample.pdf
 
TRUE OR FALSE QUESTIONS 1 In the communicable disease model.pdf
TRUE OR FALSE QUESTIONS 1 In the communicable disease model.pdfTRUE OR FALSE QUESTIONS 1 In the communicable disease model.pdf
TRUE OR FALSE QUESTIONS 1 In the communicable disease model.pdf
 
Tengo tanto sueo pueden ayudarme Tengo mucho trabajo que.pdf
Tengo tanto sueo pueden ayudarme Tengo mucho trabajo que.pdfTengo tanto sueo pueden ayudarme Tengo mucho trabajo que.pdf
Tengo tanto sueo pueden ayudarme Tengo mucho trabajo que.pdf
 
Soru 11 in ve Hindistann neden bu kadar ok uluslararas i.pdf
Soru 11  in ve Hindistann neden bu kadar ok uluslararas i.pdfSoru 11  in ve Hindistann neden bu kadar ok uluslararas i.pdf
Soru 11 in ve Hindistann neden bu kadar ok uluslararas i.pdf
 
Setting up Webserver setting up webserver and running on t.pdf
Setting up Webserver  setting up webserver and running on t.pdfSetting up Webserver  setting up webserver and running on t.pdf
Setting up Webserver setting up webserver and running on t.pdf
 
Robin has just been hired as a security engineer and wants t.pdf
Robin has just been hired as a security engineer and wants t.pdfRobin has just been hired as a security engineer and wants t.pdf
Robin has just been hired as a security engineer and wants t.pdf
 
Redgreen colorblindness is due to a recessive Xlinked alle.pdf
Redgreen colorblindness is due to a recessive Xlinked alle.pdfRedgreen colorblindness is due to a recessive Xlinked alle.pdf
Redgreen colorblindness is due to a recessive Xlinked alle.pdf
 
Required information P25 Algo Recording Transactions Pre.pdf
Required information P25 Algo Recording Transactions Pre.pdfRequired information P25 Algo Recording Transactions Pre.pdf
Required information P25 Algo Recording Transactions Pre.pdf
 
QYESTIONS 1 Why was Dakotas existing pricing system inad.pdf
QYESTIONS  1 Why was Dakotas existing pricing system inad.pdfQYESTIONS  1 Why was Dakotas existing pricing system inad.pdf
QYESTIONS 1 Why was Dakotas existing pricing system inad.pdf
 
Qu formas de vida crean nueva biomasa a travs de la produ.pdf
Qu formas de vida crean nueva biomasa a travs de la produ.pdfQu formas de vida crean nueva biomasa a travs de la produ.pdf
Qu formas de vida crean nueva biomasa a travs de la produ.pdf
 
Q1 Reminder the arrows are going from who is being eaten t.pdf
Q1 Reminder the arrows are going from who is being eaten t.pdfQ1 Reminder the arrows are going from who is being eaten t.pdf
Q1 Reminder the arrows are going from who is being eaten t.pdf
 
Oriole Corp uses a periodic inventory system A physical co.pdf
Oriole Corp uses a periodic inventory system A physical co.pdfOriole Corp uses a periodic inventory system A physical co.pdf
Oriole Corp uses a periodic inventory system A physical co.pdf
 
PREGUNTA 19 A Aumentar su comerciabilidad B Increment.pdf
PREGUNTA 19  A  Aumentar su comerciabilidad  B  Increment.pdfPREGUNTA 19  A  Aumentar su comerciabilidad  B  Increment.pdf
PREGUNTA 19 A Aumentar su comerciabilidad B Increment.pdf
 
Mira el anuncio de Disney Cruise Line Little Souvenir 00.pdf
Mira el anuncio de Disney Cruise Line Little Souvenir  00.pdfMira el anuncio de Disney Cruise Line Little Souvenir  00.pdf
Mira el anuncio de Disney Cruise Line Little Souvenir 00.pdf
 
include ltinitializer_listgt include ltiostreamgt .pdf
include ltinitializer_listgt include ltiostreamgt .pdfinclude ltinitializer_listgt include ltiostreamgt .pdf
include ltinitializer_listgt include ltiostreamgt .pdf
 
Annie wants to retain her skilled employees but she also do.pdf
Annie wants to retain her skilled employees but she also do.pdfAnnie wants to retain her skilled employees but she also do.pdf
Annie wants to retain her skilled employees but she also do.pdf
 
Header files used to run the program include ltstdioh.pdf
Header files used to run the program  include ltstdioh.pdfHeader files used to run the program  include ltstdioh.pdf
Header files used to run the program include ltstdioh.pdf
 

Recently uploaded

SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project researchCaitlinCummins3
 
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽中 央社
 
e-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopale-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi RajagopalEADTU
 
How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxCeline George
 
The Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFThe Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFVivekanand Anglo Vedic Academy
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfPondicherry University
 
The Liver & Gallbladder (Anatomy & Physiology).pptx
The Liver &  Gallbladder (Anatomy & Physiology).pptxThe Liver &  Gallbladder (Anatomy & Physiology).pptx
The Liver & Gallbladder (Anatomy & Physiology).pptxVishal Singh
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaEADTU
 
Major project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesMajor project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesAmanpreetKaur157993
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismDabee Kamal
 
Rich Dad Poor Dad ( PDFDrive.com )--.pdf
Rich Dad Poor Dad ( PDFDrive.com )--.pdfRich Dad Poor Dad ( PDFDrive.com )--.pdf
Rich Dad Poor Dad ( PDFDrive.com )--.pdfJerry Chew
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnershipsexpandedwebsite
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptNishitharanjan Rout
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...Nguyen Thanh Tu Collection
 
Contoh Aksi Nyata Refleksi Diri ( NUR ).pdf
Contoh Aksi Nyata Refleksi Diri ( NUR ).pdfContoh Aksi Nyata Refleksi Diri ( NUR ).pdf
Contoh Aksi Nyata Refleksi Diri ( NUR ).pdfcupulin
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文中 央社
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesPooky Knightsmith
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsSandeep D Chaudhary
 
How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17Celine George
 

Recently uploaded (20)

SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
 
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
 
e-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopale-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopal
 
How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptx
 
The Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFThe Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDF
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 
The Liver & Gallbladder (Anatomy & Physiology).pptx
The Liver &  Gallbladder (Anatomy & Physiology).pptxThe Liver &  Gallbladder (Anatomy & Physiology).pptx
The Liver & Gallbladder (Anatomy & Physiology).pptx
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
 
Major project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesMajor project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategies
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in Hinduism
 
Rich Dad Poor Dad ( PDFDrive.com )--.pdf
Rich Dad Poor Dad ( PDFDrive.com )--.pdfRich Dad Poor Dad ( PDFDrive.com )--.pdf
Rich Dad Poor Dad ( PDFDrive.com )--.pdf
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.ppt
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
 
Including Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdfIncluding Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdf
 
Contoh Aksi Nyata Refleksi Diri ( NUR ).pdf
Contoh Aksi Nyata Refleksi Diri ( NUR ).pdfContoh Aksi Nyata Refleksi Diri ( NUR ).pdf
Contoh Aksi Nyata Refleksi Diri ( NUR ).pdf
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical Principles
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17
 

Write a program in C++ language that implements a music play.pdf

  • 1. Write a program in C++ language that implements a music player using Doubly Circular Linked List using OOP concepts. This assignment has four parts: 1- Write a class(new type) to define the Song type. 2- Implement the Doubly Circular Linked List, which will operate with Song type. 3- Implement the Music Player 4- Test it in the main function All Constructors should use the initializer list. 1. Song class 1- class song #include <iostream> using namespace std; class Song{ private: string songTitle; string singerName; public: Song(); Song(string, string); virtual ~Song(); string getSongTitle(); string getSingerName(); void setSongTitle(string); void setSingerName(string); friend ostream& operator<<(ostream& os, Song& p){ os << ": "<<"{"<<p.songTitle<<" : "<<p.singerName<<"}"; return os; } }; 2- CNode class #include <iostream> #include "Song.h" using namespace std; class CNode{ private: Song elem; CNode *next; CNode *prev; friend class CircleDLinkedList; };
  • 2. 3- CircleDLinkedList class #include <iostream> #include "CNode.h" using namespace std; class CircleDLinkedList{ private: CNode* cursor; int size; public: CircleDLinkedList(); ~CircleDLinkedList(); bool empty(); void advance(); void add(Song &s); void remove(); void print(); int getSize() const; }; 4- MusicPlayer class #include <iostream> #include "CircleDLinkedList.h" using namespace std; class MusicPlayer{ private: string type; //will hold the type of the music player int size; //the current number of the songs CircleDLinkedList playerList; // list of the songs, CircleDLinkedList is the Doubly Circular Linked List public: MusicPlayer(string); virtual ~MusicPlayer(); void play(); //plays the current song, meaning that this method will print the properties of the Song void next(); //moves to the net song and plays it void previous(); ////moves to the previous song and plays it void add (Song); //adds a song before the current song void remove(); //removes the current song void print(bool);//prints all songs that are in the list, starting from current to left is bool param is true
  • 3. }; 5- Test it in the main function Create e musicplayer with 3 songs. Play the current song. Play the next song. Play the next song. Play the next song. Play the previous song. Print the list of the songs using bool parameter true. Print the list of the songs using bool parameter false. Remove the current song from the musicplayer. Play the current song. Play the next song. Play the next song. Play the next song. Print the list of the songs using bool parameter true. Print the list of the songs using bool parameter false.