1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
i=searchfunction(bank, total);
if (i != -1 && i > 0)
{
cout <<endl <<left <<setw(5) <<"" << "Customer Information found\n" <<endl;
cout <<left <<setw(5) <<"" << "name" << setw(24) <<right <<"" <<"Accunt Number" << setw(11) <<"" <<"balance" <<endl <<endl;
cout <<setw(5) <<"" <<setw(28) <<left <<fixed << bank[i].fullname;
cout <<setw(5) <<right << bank[i].acct<<setw(15) <<"$" <<setw(8) <<setprecision(2)<< bank[i].bal <<endl <<endl;
do{
cout <<endl <<left <<setw(5) <<"" << "Enter amount to deposit: $" ;
cin >> amount;
cin.ignore();
if (amount > 0)
{
bank[i].bal = (bank[i].bal + amount);
cout <<endl <<left <<setw(5) <<"" << "New Balance: $" << bank[i].bal <<endl;
updateInput(bank, total, fileName); // updates the customer file that was loaded in
backMenu(bank, size, total, target2, target, fileName); // back to main menu
}
else if(!cin)
{
cout <<endl <<left <<setw(5) <<"" << "Try again, Must be an integer number"<<endl;
cin.clear();
//backMenu(bank, size, total, target2, target, fileName); // back to main menu
}
else
{
cout <<endl <<setw(5) <<"" <<"Minimum Deposit has to be greater than $0\n"<<endl;
//backMenu(bank, size, total, target2, target, fileName); // back to main menu
}
}while(!cin || amount <= 0);
else
{ cout <<"customer not found" <<endl;
backMenu(bank, size, total, target2, target, fileName); // back to main menu
}
|