Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*Matt Short
- Assignment 8
- CPSC 131
- Purpose: creates a class called MovieType to read, order, and print
- information from a list of movies in a text file.*/
- //SPECIFICATION FILE
- #include<iostream>
- #include<fstream>
- #include<string>
- using namespace std;
- class MovieType
- {
- public:
- MovieType(); //constructor
- bool readMovieInfo(ifstream& readFile);
- /* Purpose: Reads information about movies 1 at a time from file
- returns false if rank<1
- Pre: The movie information is present
- Post: Info about movie has been read and stored*/
- void printMovieInfo(ofstream& printFile);
- /* Purpose: Prints info about movies 1 at a time to file
- Pre: Info about movie has been read and stored
- Post: Info about movie has been printed*/
- char getGenre();
- /* Purpose: Returns the movie's genre
- Pre: movie info has been read from file
- Post: genre has been returned*/
- int getRank();
- /* Purpose: Returns the movie's rank
- Pre: movie info has been read from file
- Post: rank has been returned*/
- bool operator>=(MovieType) const;
- /* Purpose: Overloads the operator for '<=' for use in heap.h
- Pre: <= is not overloaded
- Post: <= is overloaded*/
- bool operator>(MovieType) const;
- /* Purpose: Overloads the operator for '<' for use in heap.h
- Pre: < is not overloaded
- Post: < is overloaded*/
- ~MovieType(); //destructor
- private:
- int rank, year, votes, length;//ints to hold rank, year, votes, and length of films
- double weight;//double to hold the weight of films
- char genre;//char to hold the genre of films
- string title;//string to hold the title of films
- };
Add Comment
Please, Sign In to add comment