Player DVD program

Hey guys, I need to do an assignment for university, but I'm a complete noob, so maybe you can help me here. There is piece of code below and I need to complete it without changing anything in the main function. I will appreciate your help, it's urgent. Thank you in advance!

int main ( )
{
Player *player;
CD *cd1, *cd2;
DVD *dvd;
cd1 = new AudioCD();

cd1->LoadFromFile("C:\\...File.txt");
cd2 = new AudioCD(cd1);
// compare AudioCD by audio tracks count
cout << Max<AudioCD>(cd1, cd2) << endl;
cd2->remove(1);
cout << Max<AudioCD>(cd1, cd2) << endl;
cd2->push(new AudioTrack(new AudioFormat("MP3")));
cout << Max<AudioCD>(cd1, cd2) << endl;
cd2->push(new AudioTrack(new AudioFormat("WAV")));
cout << Max<AudioCD>(cd1, cd2) << endl;

player = new Player(cd1);
//show cd info
player->read();
player->display();
player->play();
while(player->cd->songs[player->getTrackIndex()].getTrackPosition() < 10) player->display();
player->next();
player->display();
player->setTrackIndex(10);
player->play();
while(player->cd->songs[player->getTrackIndex()].getTrackPosition() < 10) player->display();
player->stop();
player->load(cd2);
player->play(2);
player->setVolume(50);

dvd = new DVD(cd1, cd2);
player->load(dvd);
player->play();

return 0;
}
What have you learned about C++ so far? Do you know how to write a class? You're going to need to write Player, CD, DVD, AudioCD, AudioFormat, AudioTrack classes, it appears, and functions with them. I'm sure you had to have been given more instructions/requirements.

If you have no idea where to start, I suggest reviewing your course notes, and also reading the site's tutorial.
http://www.cplusplus.com/doc/tutorial/
http://www.cplusplus.com/doc/tutorial/classes/
Last edited on
Topic archived. No new replies allowed.