Skip to content

Instantly share code, notes, and snippets.

@kennedysean
Last active May 12, 2020 00:21
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/2b84ea6fb4ca455a64fdd97d5ab67b60 to your computer and use it in GitHub Desktop.
Save kennedysean/2b84ea6fb4ca455a64fdd97d5ab67b60 to your computer and use it in GitHub Desktop.
class DodStockPortfolio
{
private:
std::vector<std::string> stockSymbols;
std::vector<double> stockValues;
std::vector<double> stockAverageCosts;
std::vector<unsigned int> numShares;
std::unordered_map<std::string, int> stockIndices;
unsigned int size;
unsigned int getStockIndex(const std::string &stockSymbol);
public:
bool constructPortfolioFromFile(const std::string &fileName);
double getPortfolioCost();
double getPortfolioValue();
double getTotalReturn();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment