Browse Source

Modify function's name and parameter

remotes/origin/feature/transfer-money
Shivam Chaudhary 2 years ago
parent
commit
69b08ccb8f
  1. 4
      src/withdrawMoney.c

4
src/withdrawMoney.c

@ -2,7 +2,7 @@
#include "currentCustomerAccountBalance.c" #include "currentCustomerAccountBalance.c"
#include "updateCustomerAccountBalance.c" #include "updateCustomerAccountBalance.c"
void notifyCustomer(amountToWithdraw, remainingAccountBalance) {
void notifyCustomer(float amountToWithdraw, float remainingAccountBalance) {
char returnToHomeInput; char returnToHomeInput;
printf("You have successfully withdrawn %f €.\n", amountToWithdraw); printf("You have successfully withdrawn %f €.\n", amountToWithdraw);
@ -34,7 +34,7 @@ void withdraw(int user_id) {
if (amountToWithdraw > 0) { if (amountToWithdraw > 0) {
if (amountToWithdraw <= availableAccountBalance) { if (amountToWithdraw <= availableAccountBalance) {
remainingAccountBalance = initiateWithdraw(amountToWithdraw, availableAccountBalance); remainingAccountBalance = initiateWithdraw(amountToWithdraw, availableAccountBalance);
updateSuccess = updateAccountBalance(user_id, remainingAccountBalance);
updateSuccess = updateAvailableAccountBalance(user_id, remainingAccountBalance);
if( updateSuccess ) { if( updateSuccess ) {
notifyCustomer(amountToWithdraw, remainingAccountBalance); notifyCustomer(amountToWithdraw, remainingAccountBalance);
} }

Loading…
Cancel
Save