Answer to Question #30928 in C++ for Alec

Question #30928
List all accounts. (ID and holdings)
#include <iostream>
#include <string>
#include "StockHolding.h"
using namespace std;

class CStockAccount
{
public:
//default constructor to initialize the ID to “NoID” and the cash balance to 10,000
CStockAccount(void);
//parameterized constructor to initialize the ID and the cash balance to specific values
CStockAccount(string, double);
~CStockAccount(void);

void addStock();
void addStock(string, int);
void addStock(CStockHolding);

void deleteStock();
void deleteStock(string, int);
void deleteStock(CStockHolding);

void list();


string m_ID;
double m_CashBalance;

CStockHolding m_Holdings[10];

private:
//private function to find the index of the stock symbol in the array m_Holdings.
//Return -1 if not found.
int searchSymbol(string);
//private member to count how many kinds of stock held
int m_StockCount;
};
CStockAccount stock_accounts[10];
0
Expert's answer

Answer in progress...

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS