#include "DividendStock.h" // Constructs a new dividend stock with the given symbol and no shares. DividendStock::DividendStock(string symbol, double sharePrice) : Stock(symbol, sharePrice) { m_dividends = 0.0; } // Returns this DividendStock's market value, which is // a normal stock's market value plus any dividends. double DividendStock::marketValue() const { return shares() * sharePrice() + dividends(); } // Returns the total amount of dividends paid on this stock. double DividendStock::dividends() const { return m_dividends; } // Records a dividend of the given amount per share. void DividendStock::payDividend(double amountPerShare) { m_dividends += amountPerShare * shares(); }