#ifndef COURSE
#define COURSE
/***************************************************************
 * CLASS:  Course
 * AUTHOR: Johnny Weber
 * SID:    098609881
 * DATE:   Tue May 14 09:17:32 EDT 2002
 * DESCRIPTION:
 *         The course object represents a course as per the
 *         assignment spec.
 ***************************************************************/
#include <iostream>
#include <string>
#include <string.h>
#include <stdio.h>
#include "Tokenizer.h"

class Course {
  friend istream& operator>> (istream& in, Course& t);
  friend ostream& operator<< (ostream& out, Course& t);
 public:
  /****** C o n s t r u c t o r s ******/
  Course();
  Course(string id, string n, string p, string i, string t, int l, int s, int e);
  Course(const Course& t);

   /*********** M e t h o d s ***********/
  string   getCourseNum()  const;       // Return course id
  string   getName()       const;       // Return course name
  string   getInstructor() const;       // Return course instruc
  string   getTextISBN()   const;       // Return course text
  int      getSemester()   const;       // Return course term
  int      getEnrollment() const;       // Return number registered
  int      getLimit()      const;       // Return limit
  string   getPrereq(int i)const;       // Return prereq i
  int      getNumPrereqs() const;       // Return number of prereqs

  void   setTextbook(string isbn);      // Set the textbook
  void   setPrerequisites(string a);    // Set the prereqs

  bool hasPrereqs();                    // Are there prereqs?
  bool isOpen();                        // Test and Set: Is course open?

  bool operator == (const Course& c);   
  bool operator != (const Course& c);

  const Course& operator=(const Course& c);

  static Course parse(string text);     // Create object from 
                                        // a ':' delim string
  string toString();                    // Create a ':' delim str
                                        // from object
 private:
  string id;
  string name;
  string prereq[5];
  string instructor;
  string textbook;
  int    prereqs;
  int    limit;
  int    semester;
  int    enrollment;
};

class CourseException
{
 public:
  CourseException(string msg) {
    cout << "CourseException: " << msg << endl;
  }
};
#endif
