|
@ -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); |
|
|
} |
|
|
} |
|
|