00001 #ifndef CREDIT_CARD_H // avoid repeated expansion 00002 #define CREDIT_CARD_H 00003 00004 #include <string> // provides string 00005 #include <iostream> // provides ostream 00006 #include "Money.h" 00007 00009 class CreditCard { 00010 public: 00011 00020 CreditCard(std::string no, std::string nm, Money lim, double rt, Money bal=Money()); 00021 00023 // accessors functions 00025 00029 std::string getNumber() const; 00030 00034 std::string getName() const; 00035 00039 Money getLimit() const; 00040 00044 double getRate() const; 00045 00049 Money getCurrentBalance() const; 00050 00054 Money getPreviousBalance() const; 00055 00059 Money getMinPayment() const; 00060 00062 // update functions 00064 00075 bool chargeIt(Money price); 00076 00086 void makePayment(Money payment); 00087 00094 Money endOfMonth(); 00095 00096 00097 private: // private member data 00098 // ADD WHATEVER MEMBERS YOU WISH TO SUPPORT THE CLASS 00099 00100 00101 00102 00103 00104 00105 00106 }; 00107 // print card information 00108 std::ostream& operator<<(std::ostream& out, const CreditCard& c); 00109 #endif