Write the definition of a class PlayListEntry containing: An instance variable title of type String, initialized to the empty String. An instance variable artist of type String, initialized to the empty String. An instance variable playCount of type int, initialized to 0.

Respuesta :

// Making c++ class

class PlayListEntry{

string title;

// We cannot initialize it here in C++, ...or in many other languages as wellas i //am writing c++ class

// so i will initialize them in constructor.

string artist;

int playCount;

PlayListEntry(){

// we will initialize the variable in constructor so that they will have the desired //value when you will instantiate the class

title = ' ';

artist = ' ';

playCount = 0;

}

};