Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*Matt Short
- Assignment 7
- CPSC 131
- Purpose: Implement the functions created in the class MovieType.h*/
- //IMPLEMENTATION FILE (MOVIETYPE.H)
- #include<iostream>
- #include"movieType.h"
- #include<string>
- #include<fstream>
- using namespace std;
- MovieType::MovieType()
- {
- }
- bool MovieType::readMovieInfo(ifstream& readFile)
- {
- //Get rank
- readFile>>rank;
- if(rank>=1) //Checks to see if rank is valid
- {
- readFile>>weight;//Stores weight
- readFile>>year;//Stores year
- readFile>>votes;//Stores votes
- readFile>>genre;//Stores genre
- readFile>>length;//Stores length
- getline(readFile,title);//Stores title
- return true; //Returns Success
- }
- else //Terminates if less than 1.
- return false;
- }
- void MovieType::printMovieInfo(ofstream& printFile)
- {
- printFile<<title<<" "<<year<<" "<<genre<<" "<<length<<" "<<rank<<" "<<weight<<" "<<votes<<" "<<endl;
- }
- char MovieType::getGenre()
- {
- return genre;
- }
- int MovieType::getRank()
- {
- return rank;
- }
- bool MovieType::operator>=(MovieType check) const//check is of type MovieType
- {
- if(rank >= check.rank)//checks if rank is <= the other rank
- return true;
- else
- return false;
- }
- bool MovieType::operator>(MovieType check2) const//check2 is of type MovieType
- {
- if(rank > check2.rank)//checks if rank is < the other rank
- return true;
- else
- return false;
- }
- MovieType::~MovieType()
- {
- }
Add Comment
Please, Sign In to add comment