    01: /**
    02:    @file invoice.cpp
    03:    @author Cay Horstmann
    04: */
    05:
    06: #include <string>
    07:
    08: using namespace std;
    09:
    10: /**
    11:    Describes a product with a description and a price.
    12: */
    13: class Product
    14: {
    15: public:
    16:    /**
    17:       Gets the product description.
    18:       @return the description
    19:    */
    20:    string get_description() const;
    21:
    22:    /**
    23:       Gets the product price.
    24:       @return the unit price
    25:    */
    26:    double get_price() const;
    27: };
    28:
    29: /**
    30:    Describes an invoice for a set of purchased products.
    31: */
    32: class Invoice
    33: {
    34: public:
    35:    /**
    36:       Adds a charge for a product to this invoice.
    37:       @param aProduct the product that the customer ordered
    38:       @param quantity the quantity of the product
    39:    */
    40:    void add(Product p, int quantity);
    41:    /**
    42:       Prints the invoice.
    43:    */
    44:    void print() const;
    45: };
    46:
    47: /**
    48:    Describes a quantity of an article to purchase and its price.
    49: */
    50: class Item
    51: {
    52: public:
    53:    /**
    54:       Computes the total cost of this item.
    55:       @return the total price
    56:    */
    57:    double get_total_price() const;
    58:
    59:    /**
    60:       Prints this item.
    61:    */
    62:    void print() const;
    63: };
    64:
    65: /**
    66:    Describes a mailing address.
    67: */
    68: class Address
    69: {
    70: public:
    71:    /**
    72:       Prints the address.
    73:    */
    74:    void print() const;
    75: };
    76:
    77: