double print_total(std::ostream& os, const Quote& item, size_t n) { double ret = item.net_price(n); os << "ISBN:" << item.isbn() << "# sold: " << n << "total due: " <<ret << std::endl; return ret; }
double print_total(ostream& os, const Quote& item, size_t number){ double ret = item.net_price(number); os << "ISBN: " << item.isbn() << " # sold: " << number << " total due: " << ret << endl; return ret; }
double print_total(std::ostream& out, const Quote& item, std::size_t n) { // depending on the type of the object bound to the item parameter // call corresponding functuon either Quote::net_price or Bulk_quote::net_price double ret = item.net_price(n); out << "IBSN: " << item.isbn() << " # sold: " << n << " total due: " << ret << std::endl; return ret; }
// non-member double print_total(std::ostream &os, const Quote &item, size_t n) { // depending on the type of the object bound to the item parameter // calls either Quote::net_price or Bulk_quote::net_price double ret = item.net_price(n); os << "ISBN: " << item.isbn() // calls Quote::isbn << " # sold: " << n << " total due: " << ret << std::endl; return ret; }
double print_total(ostream& os, Quote const& item, size_t sold) { double net_price = item.net_price(sold); os << "isbn: " << item.isbn() << ", sold: " << sold << ", total due: " << net_price << endl; return net_price; }
void printTotal(ostream& os, const Quote& book, const size_t bookNum) { os << book.isbn() <<":" <<book.net_price(bookNum); }