Hi people,I'm getting an unexpected output when I call this program just for example I add 200 to the bank account then it asks me if I want to enter more I say yes and add another 200 but the output is only 200 not 400 it seems if its avoiding whats in the If block of code.
#include <iostream>
#include "bank.h"
usingnamespace std;
int main()
{
int enter;
cout << "enter an amount you want to put in" << endl;
cin >> enter;
bank will(enter);
cout << "do you want to add any money" << endl;
char add;
cin >> add;
if (add == 'y'){
cout << "how much do you want to add" << endl;
int more;
cin >> more;
will.addAmount(more);
}
cout << will.getAmount();
return 0;
}