You work for an online video store You are building a class
You work for an online video store. You are building a class to be able to hold all the information for the Videos including title, genre, and release date. Also, remember to separately create mutator and accessor functions for setting the title of a video and the genre. HINT: Write the declaration only for this class. You’ll need to declare four functions.
Solution
class OnlineVideoStore
{
private:
string title; //information in the form of variables title,genre and release date
string genre;
string releasedate;
public:
void setTitle(string title) //mutator and accessor for title
{
this->title = title;
}
string getTitle()
{
return title;
}
void setGenre(string genre) //mutator and accessor for genre
{
this->genre = genre;
}
string getGenre()
{
return genre;
}
};
