Skip to content

Instantly share code, notes, and snippets.

@kennedysean
Created May 12, 2020 00:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kennedysean/ec05ae8c364ca731be52cbb752e04441 to your computer and use it in GitHub Desktop.
Save kennedysean/ec05ae8c364ca731be52cbb752e04441 to your computer and use it in GitHub Desktop.
struct StockPosition
{
std::string stockSymbol;
double stockValue;
double stockAverageCost;
unsigned int numShares;
};
class OopStockPortfolio
{
private:
std::vector<StockPosition> stockPortfolio;
unsigned int size;
public:
bool constructPortfolioFromFile(const std::string &fileName);
double getPortfolioValue();
double getPortfolioCost();
double getTotalReturn();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment