Savings::Savings(double amt, double intRate) : BankAccount(amt) {
interestRate = amt * intRate;
}
Savings::~Savings()
{
//dtor
}
void Savings::applyInterest() {
balance += interestRate;
}
void Savings::deposit(double amt) {
BankAccount::deposit(amt);
} // calls deposit from base class
void Savings::withdraw(double amt) {
if (balance <= 0) {
exit(0);
cout << "Your balance is negative!" << endl;
} else {
BankAccount::withdraw(amt);
}
} // checks if enough funds before calling withdraw from base class
void Savings::printMonthlyStatement() {
cout << "Savings statement: " << endl;
cout << "Balance after interest: " << balance;
}// prints monthly statement after calculating the interest to update the balance
I don't really see what ht problem is, I get no compiler error but just a blank console. Even if my variables have nothing shouldn't I still atleast get the " " printed?