If you have any doubts, please give me comment...
#include<iostream>
#include<string>
using namespace std;
char song_titles[4][10] = {"Song 1", "Song 2", "Song 3", "Song 4"};
class musicPlayer{
bool isPlaying;
bool isStopped;
string currentSongTitle;
string nextSongTitle;
string currentSongLength;
void play();
void stop();
void SkipToNextSong();
};
void musicPlayer::play(){
if(currentSongTitle=="")
currentSongTitle = song_titles[0];
isPlaying = true;
isStopped = false;
}
void musicPlayer::stop(){
isStopped = true;
isPlaying = false;
}
void musicPlayer::SkipToNextSong(){
int pos = 0;
for(int i=0; i<4; i++){
if(song_titles[i]==currentSongTitle){
pos = i;
break;
}
}
currentSongTitle = song_titles[(pos+1)%4];
nextSongTitle = song_titles[(pos+2)%4];
}
cpp Lab Quiz 2 Time Slot: Mon 1-2 PM Deadline: 05/13/2019 2:00 PM Submission: Email Subject: CSC 102 CC3/CC4 LabQuiz 2TS 2 FileType: cpp Write a program to define a music player. Music player has...
CSC 142 Music Player You will complete this project by implementing one class. Afterwards, your program will play music from a text file. Objectives Working with lists Background This project addresses playing music. A song consists of notes, each of which has a length (duration) and pitch. The pitch of a note is described with a letter ranging from A to G. 7 notes is not enough to play very interesting music, so there are multiple octaves; after we reach...