Ok.. this is an assignment.. i'm not going to lie.
but i have done almost everything of it.. just need some help on the stl <vector>/ <list>
this is my code for the question..
using namespace std;
customer(string inName, string inAddress, int inPhoneNum);
friend bool operator==(const customer &left, const customer &right);
bool operator==(const customer &left, const customer &right)
customer::customer(string inName, string inAddress, int inPhoneNum)
name = inName;
address = inAddress;
phoneNum = inPhoneNum;
vector <customer> transactions;
Account(int inAccountNumber, double inAccountBalance,
int inDateOpened,vector <customer> inTransactions);
Account::Account(int inAccountNumber, double inAccountBalance, int inDateOpened,
vector <customer> inTransactions)
accountNumber = inAccountNumber;
accountBalance = inAccountBalance;
dateOpened = inDateOpened;
transactions = inTransactions;
class checkingAccount: public Account
checkingAccount(int inAccountNumber, double inAccountBalance,
int inDateOpened, vector <customer> inTransactions, string inChequeStyle,
class savingsAccount: public Account
savingsAccount( int inAccountNumber, double inAccountBalance,
int inDateOpened, vector <customer> inTransactions, int inInterestRate);
A general bank Account has the following basic features. It has:
• the accountBalance. This maintains the current balance in the account and
makes it easy for us to decide when withdrawals should be disallowed;
A bank account system design class diagram
• transactions, consisting of the amount, positive or negative, which is added
to the account. A deposit is a positive transaction and a withdrawal is a
negative transaction. Transaction details are held together dynamically in a
‘linked’ structure. The most recent transaction will be the last entry added.
The amount of the transaction could be a float or a double. You choose. If
you are a ‘big’ spender you will probably use doubles! If we sum the
amounts stored in the transaction list it will equal the accountBalance;
• an accountNumber. You could get the system to do this automatically or
look to add it in yourself. Again you choose. Please explain the reason for
your choice however.
You have met 'linked structures' previously. Use the STL to manage the collection
// just posted the question to allow you have more understanding of it (which frankly i don't have atm)..
how to add stl to the transactions?
do i have to declare it under customer class or the account class?
and thanks in advance