#include "multimedia.h" #include using std::ofstream; using std::ifstream; #include using std::setprecision; multimedia::multimedia() { name = ""; type = ""; author = ""; owner = ""; price = -9999; status = ""; } multimedia::multimedia( string aname, string atype, string anauthor, string anowner, double aprice, string astatus) { name = aname; type = atype; author = anauthor; owner = anowner; price = aprice; status = astatus; } string multimedia::getname( ) const { return name; } string multimedia::gettype( ) const { return type; } string multimedia::getauthor( ) const { return author; } string multimedia::getowner( ) const { return owner; } double multimedia::getprice( ) const { return price; } string multimedia::getstatus( ) const { return status; } void multimedia::print( ofstream& out, bool displayowner) const { if(name != "") out << "Item:\n " << name << "\n"; if (type != "") out << "Media Type:\n " << type << "\n"; if(author != "") out << "by:\n " << author << "\n"; if(owner != "" && displayowner) out << "Owner:\n " << owner << "\n"; if(price != -9999 && price!=0) out << "Price:\n $" << setprecision(4) << price << "\n"; if(status != "") out << "Availability:\n " << status << "\n"; }