I have a quick question with a code I am doing. I am enteringa deposit in an atm
ID: 3617662 • Letter: I
Question
I have a quick question with a code I am doing. I am enteringa deposit in an atm program and I have an option after the amountis entered to ask the user to enter a new transaction. Anyways what I am trying to do is get the function to accumulatethe money so it will return an error if the total deposits for theatm exceed 10000. Here is my code for the function. Ihave no problem sending the entire code but it is over 1000 linesso if any of you guys can take a look a this without the entirecode please let me knowvoid depositTest(double money)
{
double depositTotal = 0;
while (money <= 10000 && choice ==2)
{
depositTotal += money;
}
//if money is greater than 10000 ifstatement
if (money > 10000 && choice == 2)
{
//show an error message
cout << endl <<"This ATM has encountered the following error...";
cout << endl <<"This atm has reached the total amount of deposits it canhold.";
cout << endl <<"We apologize for this inconvenience.";
cout << endl;
//exit the program if theerror occurs
exit(0);
}
}