/*** Saeteurn, San ecst_sfs@ecst.csuchico.edu Program 2: Video Rating System ***/ #include #include #include "video.h" using namespace std; Video::Video() { m_totalVids = 1; } /* PreConditions: comparedVid is not NIL PostConditions: Compares the inputed video's Video name and Artist with the current video's. Returns true if is equal, false otherwise. */ bool Video::equals(string vidName,string artist) { if (vidName == m_videoName) { if (artist == m_artist) { return true; } else { return false; } } else { return false; } } string Video:: getName() { return m_videoName; } string Video::getArtist() { return m_artist; } double Video::getRating() { return m_videoRating; } void Video::averageRate() { m_videoRating = m_videoRating/m_totalVids; } void Video::setVideoName(string vidName) { m_videoName = vidName; } void Video::setArtist(string artName) { m_artist = artName; } void Video::setRating(double vidRating) { m_videoRating = vidRating; } void Video::setAll(string vidName,string artName,double vidRating) { m_videoName = vidName; m_artist = artName; m_videoRating = vidRating; } void Video::setTotalVids() { m_totalVids++; } /* Displays the current video name, artist, and rating. */ void Video::displayRating() { cout << m_videoName << " by " << m_artist << ", rating = " << m_videoRating << endl; }