/* Project 2 for CS 1704, Spring 2004 Programmer: John Christopher Humphreys OS: Windows XP Professional System: Pentium M, 512 MB Compiler: Microsoft Visual Studio.net 2003 Last Modified: February 14, 2004 Purpose- This program will store student data and data of certain items in two arrays. Classes will be created to hold and manage data of each kind, and a class will manage the arrays. Data can be edited, printed, or cleared by the controlling class, and all commands, taken from an input file, will be processed and executed. Format for Comment Block provided by (http://courses.cs.vt.edu/~cs1704/spring2004/Standards/ProgramHeader.txt) */ #include "Item.h" // Include Item Class Item::Item() /* Item::Item Constructor Parameters: Item Items[] Pre: None Post: An object of type Item has been created Returns: None Called by: Control::Control() Calls: None */ { Title = Type = Author = Owner = Availability = ""; Price = 0.0; } string Item::PrintTitle() const /* Item::PrintTitle Accessor Parameters: Item Items[] Pre: None Post: The title of the object is returned to the calling function Returns: None Called by: Control::PrintItems() Control::AddItem() Calls: None */ { return Title;} string Item::PrintType() const /* Item::PrintType Accessor Parameters: Item Items[] Pre: None Post: The type of the object is returned to the calling function Returns: None Called by: Control::PrintItems() Control::AddItem() Calls: None */ { return Type;} string Item::PrintAuthor() const /* Item::PrintAuthor Accessor Parameters: Item Items[] Pre: None Post: The author of the object is returned to the calling function Returns: None Called by: Control::PrintItems() Control::AddItem() Calls: None */ { return Author;} string Item::PrintOwner() const /* Item::PrintOwner Accessor Parameters: Item Items[] Pre: None Post: The owner of the object is returned to the calling function Returns: None Called by: Control::PrintItems() Control::AddItem() Calls: None */ { return Owner;} double Item::PrintPrice() const /* Item::PrintPrice Accessor Parameters: Item Items[] Pre: None Post: The price of the object is returned to the calling function Returns: None Called by: Control::PrintItems() Control::AddItem() Calls: None */ { return Price;} string Item::PrintAvailability() const /* Item::PrintAvailability Accessor Parameters: Item Items[] Pre: None Post: The availability of the object is returned to the calling function Returns: None Called by: Control::PrintItems() Control::AddItem() Calls: None */ { return Availability;} void Item::AddTitle(string NewTitle) /* Item::AddTitle Mutator Parameters: Item Items[] Pre: None Post: The title of the object is stored as NewTitle Returns: None Called by: Control::Control() Control::AddItem() Calls: None */ { Title = NewTitle;} void Item::AddType(string NewType) /* Item::AddType Mutator Parameters: Item Items[] Pre: None Post: The type of the object is stored as NewType Returns: None Called by: Control::Control() Control::AddItem() Calls: None */ { Type = NewType;} void Item::AddAuthor(string NewAuthor) /* Item::AddAuthor Mutator Parameters: Item Items[] Pre: None Post: The author of the object is stored as NewAuthor Returns: None Called by: Control::Control() Control::AddItem() Calls: None */ { Author = NewAuthor;} void Item::AddOwner(string NewOwner) /* Item::AddOwner Mutator Parameters: Item Items[] Pre: None Post: The owner of the object is stored as NewOwner Returns: None Called by: Control::Control() Control::AddItem() Calls: None */ { Owner = NewOwner;} void Item::AddPrice(double NewPrice) /* Item::AddPrice Mutator Parameters: Item Items[] Pre: None Post: The price of the object is stored as NewPrice Returns: None Called by: Control::Control() Control::AddItem() Calls: None */ { Price = NewPrice;} void Item::AddAvailability(string NewAvailability) /* Item::AddAvailability Mutator Parameters: Item Items[] Pre: None Post: The availability of the object is stored as NewAvailability Returns: None Called by: Control::Control() Control::AddItem() Calls: None */ { Availability = NewAvailability;} // Design Change, delete functions were created and used rather than using the add functions void Item::DeleteTitle() /* Item::DeleteTitle Mutator Parameters: Item Items[] Pre: None Post: The title of the object is cleared Returns: None Called by: Control::DeleteAllE_mail() Calls: None */ { Title = "";} void Item::DeleteType() /* Item::DeleteType Mutator Parameters: Item Items[] Pre: None Post: The type of the object is cleared Returns: None Called by: Control::DeleteAllE_mail() Calls: None */ { Type = "";} void Item::DeleteAuthor() /* Item::DeleteAuthor Mutator Parameters: Item Items[] Pre: None Post: The author of the object is cleared Returns: None Called by: Control::DeleteAllE_mail() Calls: None */ { Author = "";} void Item::DeleteOwner() /* Item::DeleteOwner Mutator Parameters: Item Items[] Pre: None Post: The owner of the object is cleared Returns: None Called by: Control::DeleteAllE_mail() Calls: None */ { Owner = "";} void Item::DeletePrice() /* Item::DeletePrice Mutator Parameters: Item Items[] Pre: None Post: The price of the object is cleared Returns: None Called by: Control::DeleteAllE_mail() Calls: None */ { Price = 0.0;} void Item::DeleteAvailability() /* Item::DeleteAvailability Mutator Parameters: Item Items[] Pre: None Post: The availability of the object is cleared Returns: None Called by: Control::DeleteAllE_mail() Calls: None */ { Availability = "";} /*On my honor: - I have not discussed the C++ language code in my program with anyone other than my instructor or the teaching assistants assigned to this course. - I have not used C++ language code obtained from another student, or any other unauthorized source, either modified or unmodified. - If any C++ language code or documentation used in my program was obtained from another source, such as a textbook or course notes, that has been clearly noted with a proper citation in the comments of my program. - I have not designed this program in such a way as to defeat or interfere with the normal operation of the Curator System. */