예제 #1
0
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;

}
예제 #3
0
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;
}
예제 #4
0
// 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;
}
예제 #5
0
파일: cxx_case.cpp 프로젝트: keitee/kb
  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;
  }
예제 #6
0
void printTotal(ostream& os, const Quote& book, const size_t bookNum)
{
    os << book.isbn() <<":" <<book.net_price(bookNum);
}