SlideShare a Scribd company logo
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.pdf
illyasraja7
 
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
ARCHANASTOREKOTA
 
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
aanyajoshi90
 
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
ankit11134
 
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
sunilverma8487
 
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
facevenky
 
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
meenaaarika
 
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
fazanmobiles
 
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
adinathknit
 
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.pdf
mukulsingh0025
 
Hsjs.pdf
Hsjs.pdfHsjs.pdf
Hsjs.pdf
Jyotimoydas2
 
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
fashination
 
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
shreeaadithyaacellso
 
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
shreeaadithyaacellso
 
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
apleathers
 
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
dbrienmhompsonkath75
 
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
herminaherman
 
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
arorasales234
 

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.pdf
iconsystemsslm
 
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
iconsystemsslm
 
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
iconsystemsslm
 
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
iconsystemsslm
 
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
iconsystemsslm
 
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
iconsystemsslm
 
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
iconsystemsslm
 
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
iconsystemsslm
 
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
iconsystemsslm
 
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
iconsystemsslm
 
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
iconsystemsslm
 
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
iconsystemsslm
 
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
iconsystemsslm
 
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
iconsystemsslm
 
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
iconsystemsslm
 
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
iconsystemsslm
 
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
iconsystemsslm
 
include ltinitializer_listgt include ltiostreamgt .pdf
include ltinitializer_listgt include ltiostreamgt .pdfinclude ltinitializer_listgt include ltiostreamgt .pdf
include ltinitializer_listgt include ltiostreamgt .pdf
iconsystemsslm
 
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
iconsystemsslm
 
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
iconsystemsslm
 

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

Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Po-Chuan Chen
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 

Recently uploaded (20)

Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 

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.