darkhelmet125

movieType.h

Dec 7th, 2011
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.59 KB | None | 0 0
  1. /*Matt Short
  2. Assignment 8
  3. CPSC 131
  4. Purpose: creates a class called MovieType to read, order, and print
  5. information from a list of movies in a text file.*/
  6. //SPECIFICATION FILE
  7. #include<iostream>
  8. #include<fstream>
  9. #include<string>
  10. using namespace std;
  11. class MovieType
  12. {
  13. public:
  14.     MovieType();    //constructor
  15.     bool readMovieInfo(ifstream& readFile);
  16.         /*  Purpose: Reads information about movies 1 at a time from file
  17.                 returns false if rank<1
  18.             Pre: The movie information is present
  19.             Post: Info about movie has been read and stored*/
  20.     void printMovieInfo(ofstream& printFile);
  21.         /*  Purpose: Prints info about movies 1 at a time to file
  22.             Pre: Info about movie has been read and stored
  23.             Post: Info about movie has been printed*/
  24.     char getGenre();
  25.         /*  Purpose: Returns the movie's genre
  26.             Pre: movie info has been read from file
  27.             Post: genre has been returned*/
  28.     int getRank();
  29.         /*  Purpose: Returns the movie's rank
  30.             Pre: movie info has been read from file
  31.             Post: rank has been returned*/
  32.     bool operator>=(MovieType) const;
  33.         /*  Purpose: Overloads the operator for '<=' for use in heap.h
  34.             Pre: <= is not overloaded
  35.             Post: <= is overloaded*/
  36.     bool operator>(MovieType) const;
  37.         /*  Purpose: Overloads the operator for '<' for use in heap.h
  38.             Pre: < is not overloaded
  39.             Post: < is overloaded*/
  40.     ~MovieType();   //destructor
  41. private:
  42.     int rank, year, votes, length;//ints to hold rank, year, votes, and length of films
  43.     double weight;//double to hold the weight of films
  44.     char genre;//char to hold the genre of films
  45.     string title;//string to hold the title of films
  46. };
  47.  
Add Comment
Please, Sign In to add comment