// Project 2 for CS 1704 Spring II 2004 // // Programmer: Mason Shea // OS: Windows XP // System: Pentium III 500, 256 MB Memory // Compiler: Visual C++ 6.0, Service Pack 4 // Last modified: February 25, 2004 // // Purpose // The purpose of this file is to declare functions and create an interface // for an object of type item. The item has many different fields, a // default constructor, regular constructor, and copy constructor, along with // mutator operations for changing the data members and accessor operations // for returning the values of the data members without changing them. Finally, // the item class has an overloaded assignment operator = so that an item // can be assigned an item's data without having to implement the changes // in every field of an item each time this occurs, which only happens in the // organizer class. #ifndef ITEMS_H #define ITEMS_H #include using namespace std; using std::string; class Item { public: Item(); //default constructor Item(string myItem, string MediaType, string By, string Owner, double Price, string Availability); //constructor Item(const Item&); //copy constructor; //Mutator operations - assigns given data type to set values void setItem(string); void setMediaType(string); void setBy(string); void setOwner(string); void setPrice(double); void setAvailability(string); //Accessor operations - returns a private data member string getItem() const; string getMediaType() const; string getBy() const; string getOwner() const; double getPrice() const; string getAvailability() const; //overloaded assignment operator = allows for copying of one item's data into another's Item& Item::operator=(const Item&); private: string myItem; string myMediaType; string myBy; string myOwner; double myPrice; string myAvailability; }; #endif