#include #include #include #include #include "multimedia.h" using namespace std; Multimedia::Multimedia() { //formats all of the data members to base values string Item = ""; string Type = ""; string Owner = ""; string Price = ""; string Availability = ""; string By = ""; } int Multimedia::Delete() { //resets all of the data members to default values so it can be recognised as a blank space in the array in container class. Item = ""; Type = ""; Owner = ""; Price = ""; Availability = ""; By = ""; return 1; } int Multimedia::Print(ofstream &Out, int POwner) { //prints out the multimedia item. the POwner inputted integer will tell this function whether or not to output the owners email address if(Item != "")Out << "Item:" << endl << " " << Item << endl; if(Type != "")Out << "Media Type:" << endl << " " << Type << endl; if(By != "")Out << "by:" << endl << " " << By << endl; if(POwner) Out << "Owner:" << endl << " " << Owner << endl;//only print the owner if we are supposed to. if(Price != "")Out << "Price:" << endl << " " << Price << endl; if(Availability != "")Out << "Availability:" << endl << " " << Availability << endl; return 1; } //the rest are simple mutators or accessors. string Multimedia::getItem() { return Item; } int Multimedia::setItem(string Input) { Item = Input; return 1; } string Multimedia::getType() { return Type; } int Multimedia::setType(string Input) { Type = Input; return 1; } string Multimedia::getBy() { return By; } int Multimedia::setBy(string Input) { By = Input; return 1; } string Multimedia::getOwner() { return Owner; } int Multimedia::setOwner(string Input) { Owner = Input; return 1; } string Multimedia::getPrice() { return Price; } int Multimedia::setPrice(string Input) { Price = Input; return 1; } string Multimedia::getAvailability() { return Availability; } int Multimedia::setAvailability(string Input) { Availability = Input; return 1; }