// Project 2 for CS 1704 Spring 2004 // // Programmer: Deborah A Thompson // OS: Windows XP Professional // System: Pentium III 500, 256 MB Memory // Compiler: Visual C++ 6.0, Service Pack 4 // Last modified: Febraury 23, 2004 // // Purpose: Each item class should provide access functions to // private data to update/view the information. Additionally, // each item should be able to print to the log stream in the // described format. #include #include "Item.h" //////////////////////////////////////////////////////////////// Item // constructor, sets default values to item things // // Parameters: // none // // Pre: None // // Post: all item values are set to defaults // // Returns: nothing // // Called by: // Calls: none // Item::Item() { bItem = DEFAULT; Type = DEFAULT; Author = DEFAULT; Owner = DEFAULT; Price = ""; Status = "EMPTY"; } //////////////////////////////////////////////////////////////// ~Item //deconstructors // Item::~Item() { //empty no dynamic variables } //////////////////////////////////////////////////////////////// IUpdate // updates and changes the item database // // Parameters: // bItem - Item name // Type - Item type // Author - Item author // Owner - Item owner // Price - Item price // Status - Item status // // Pre: values have been set to item database // // Post: none // // Returns: none // // Called by: // Calls: None // void Item::IUpdate(string& inItem, string& inType, string& inAuthor, string& inOwner, string& inPrice, string& inStatus) { bItem = inItem; Type = inType; Author = inAuthor; Owner = inOwner; Price = inPrice; Status = inStatus; return; } //////////////////////////////////////////////////////////////// ViewAll // allows for all values to be viewed // // Parameters: // bItem - Item name // Type - Item type // Author - Item author // Owner - Item owner // Price - Item price // Status - Item status // // Pre: values of item database, array must be set // // Post: none // // Returns: none // // Called by: // Calls: None // //passes back all the values of Item void Item::ViewAll(string& inItem, string& inType, string& inAuthor, string& inOwner, string& inPrice, string& inStatus) { inItem = bItem; inType = Type; inAuthor = Author; inOwner = Owner; inPrice = Price; inStatus = Status; return; } //////////////////////////////////////////////////////////////// ViewOwner // allows owner's email to be accessed // // Parameters: // None // // Pre: Item array been set. // // Post: None // // Returns: Owner email // // Called by: // Calls: None // //returns email address of the owner string Item::ViewOwner() { return Owner; }