c++ homework help assignment 11

homeworkhelp325
movie.cpp

// Movie.cpp #include "Movie.h" // include Movie class definition #include <sstream> using namespace std; Movie::Movie() { title = studio = ""; boxOffice[WORLD] = boxOffice[US] = boxOffice[NON_US] = rank[WORLD] = rank[US] = rank[NON_US] = releaseYear = 0; } Movie::Movie(string temp) { istringstream iS(temp); getline(iS, title, '\t'); getline(iS, studio, '\t'); iS >> releaseYear >> boxOffice[WORLD] >> boxOffice[US] >> boxOffice[NON_US] >> rank[WORLD] >> rank[US] >> rank[NON_US]; } string Movie::getTitle() const {return title;} string Movie::getStudio() const {return studio;} long long Movie::getUSBoxOffice() const {return boxOffice[US];} long long Movie::getNonUSBoxOffice() const {return boxOffice[NON_US];} long long Movie::getWorldBoxOffice() const {return boxOffice[WORLD];} int Movie::getUSRank() const {return rank[US];} int Movie::getNonUSRank() const {return rank[NON_US];} int Movie::getWorldRank() const {return rank[WORLD];} int Movie::getReleaseYear() const {return releaseYear;} ostream& operator <<(ostream& oS, const Movie& m) { oS << "\n\n====================== Movie Information\n" << "\n Movie Title:\t" << m.title << " (" << m.releaseYear << ")" << "\n US Rank & Box Office:\t" << m.rank[m.US] << "\t$" << m.boxOffice[m.US] << "\nNon-US Rank & Box Office:\t" << m.rank[m.NON_US] << "\t$" << m.boxOffice[m.NON_US] << "\n World Rank & Box Office:\t" << m.rank[m.WORLD] << "\t$" << m.boxOffice[m.WORLD] << "\n"; return oS; } Movie::Movie(const Movie &mP) { // private copy constructor blocks invocation this->title = mP.title; this->studio = mP.studio; this->releaseYear = mP.releaseYear; this->rank[US] = mP.rank[US]; this->rank[NON_US] = mP.rank[NON_US]; this->rank[WORLD] = mP.rank[WORLD]; this->boxOffice[US] = mP.boxOffice[US]; this->boxOffice[NON_US] = mP.boxOffice[NON_US]; this->boxOffice[WORLD] = mP.boxOffice[WORLD]; }