G
Gary Wessle
Hi
I would appricate some help in figuring out how to so this.
I have an unspecified number-of-persons who have access to a joint bank
account. each person is assigned 20 transactions, one person can't
make 2 consecutive transactions, but they take turns, the description
of a transaction "deposit/withdrawal, amount,..." a person makes
depends on the current account status "balance, ..." as well as the
description of the last transaction this person did on the account and
that person status "type of access he has to the account".
I need to keep updated records for each person to help them make the
decision at the time of their transactions.
class persons
{
string name;
string status;
....
};
class transaction
{
string type;
double amount;
public:
transaction(string person_name);
};
class account
{
string status; //over drawn ...etc
double balance;
...
public
account();
};
vector <persons> persons;
for(int i = 0; i < 20; i++){ //for each round of transactions turn
for(int j=0; j < number-of-persons; j++){ //for each person do
transaction (person[j].name);
but how do I keep this transaction in memory for this person as well
as the account updated.
thank you
I would appricate some help in figuring out how to so this.
I have an unspecified number-of-persons who have access to a joint bank
account. each person is assigned 20 transactions, one person can't
make 2 consecutive transactions, but they take turns, the description
of a transaction "deposit/withdrawal, amount,..." a person makes
depends on the current account status "balance, ..." as well as the
description of the last transaction this person did on the account and
that person status "type of access he has to the account".
I need to keep updated records for each person to help them make the
decision at the time of their transactions.
class persons
{
string name;
string status;
....
};
class transaction
{
string type;
double amount;
public:
transaction(string person_name);
};
class account
{
string status; //over drawn ...etc
double balance;
...
public
account();
};
vector <persons> persons;
for(int i = 0; i < 20; i++){ //for each round of transactions turn
for(int j=0; j < number-of-persons; j++){ //for each person do
transaction (person[j].name);
but how do I keep this transaction in memory for this person as well
as the account updated.
thank you