Hi everyone,
I writing a program in which two methods I want to count when it is called. I don't know how to do this.
//parent class
void BankAccount::deposit(double dep)
{
if(dep > 0)
balance += dep;
}
void BankAccount::withdraw(double wd)
{
if(wd > 0 && wd <= balance)
balance -= wd;
}
That is transactionCount is a variable which is incremented when anyone of the above function is called.
//child class
CheckingAccount::CheckingAccount
{
transactionCount = 0;
}