You have lots of unused variables and in here you had 2 for-loops that were not needed.
cout<<"Starting balance for Account 1: "<<banker1.accountBalance<<endl;
cout<<"Starting balance for Account 2: "<<banker2.accountBalance<<endl;
double newMonthlyBalance1 = banker1.accountBalance;
double newMonthlyBalance2 = banker2.accountBalance;
for(year = 1; year <= numberOfYears; year ++)
{
cout<<"Year "<<year<<" "<<endl;
for(month = 1; month <= 12; month ++)
{
cout<<"Month "<<month<<" "<<endl;
banker1.accountBalance = (banker1.accountBalance * (1 + monthlyInterestRate1)) + monthlyDepositAmount - monthlyWithdrawalAmount;
cout<<"Balance for first account: "<<banker1.accountBalance<<endl;
banker2.accountBalance = (banker2.accountBalance * (1 + monthlyInterestRate2)) + monthlyDepositAmount - monthlyWithdrawalAmount;
cout<<"Balance for second account: "<<banker2.accountBalance<<endl;
}
cout<<endl;
}