I need to get the break statements on lines 27 and 45 out of my code.I am trying to make this program loop 3 times for a correct pin code and I can get it to work using break. I have to make it work without break, continue, or return statements. Any suggestions?
int main()
{
string name;
double stowyBalance = 0,
mildredBalance = 0,
stowyAtm = 0,
mildredAtm = 0,
stowyBalanceReward = 0,
mildredBalanceReward = 0;
do
{
cout << "Please enter your first and last name. or END to exit\n"; ///ASK FOR NAME
getline (cin, name);
if (name == "Joey Stowy")
{
int stowyPin;
for (int i=0;i<3;i++)
{
cout << "Please enter your PIN Joey, or 9 to exit.\n";
cin >>stowyPin;
if (stowyPin == 4433)
stowyBalance = stowyBank(stowyAtm);
elseif (stowyPin == 9)
break;
else cout<<"Pls try again!!!\n";
}
}
elseif (name == "Mildred Moredebt")
{
int mildredPin = 0;
for (int i=0;i<3;i++)
{
cout << "Please enter your PIN Mildred, or 9 to exit.\n";
cin >>mildredPin;
if (mildredPin == 2849)
mildredBalance = mildredBank(mildredAtm);
elseif (mildredPin == 9)
break;
else cout<<"Pls try again!!!\n";
}
}
}while (name != "END"); //loops and error checks until user enters END