#ifndef CREDIT_CARD_H // avoid repeated expansion #define CREDIT_CARD_H #include // provides string #include // provides ostream using std::string; // make string accessible class CreditCard { private: // private member data string number; // credit card number string name; // card owner's name int limit; // credit limit double balance; // credit card balance public: // standard constructor CreditCard(string no, string nm, int lim, double bal=0); // accessors functions string getNumber() const { return number; } string getName() const { return name; } double getBalance() const { return balance; } int getLimit() const { return limit; } // update functions bool chargeIt(double price); // make a charge void makePayment(double payment) // make a payment { balance -= payment; } string toString() const; // representation of card information }; // print card information std::ostream& operator<<(std::ostream& out, const CreditCard& c); #endif