#ifndef STOCK_H_
#define STOCK_H_

#include <string>
#include <iostream>

using namespace std;

// A Stock object represents purchases of shares of a stock.
class Stock {
 public:
  Stock(const std::string &symbol, double share_price = 0.0);

  // Stock's mutator/accessor methods.
  void   Purchase(int shares, double share_price);
  int    get_shares() const;
  double get_share_price() const;
  void   set_share_price(double share_price);
  string get_symbol() const;

  // Stock's "investment" interface.
  double GetCost() const;
  double GetMarketValue() const;
  double GetProfit() const;

  // Overload (ostream& <<) so we can print Stock.
  friend ostream &operator<<(std::ostream &out, const Stock &rhs);

 private:
  string symbol_;
  int    shares_;
  double cost_;
  double share_price_;
};

#endif  // STOCK_H_