diff --git a/src/withdrawMoney.c b/src/withdrawMoney.c index 9ccf70a..4bd3eaf 100644 --- a/src/withdrawMoney.c +++ b/src/withdrawMoney.c @@ -41,6 +41,12 @@ bool withdraw(int user_id) { if (amountToWithdraw > 0) { if (amountToWithdraw <= availableAccountBalance) { + + if(amountToWithdraw>MAX_AMOUNT){ + printf("\nYou cannot withdraw more than %d€.",MAX_AMOUNT); + return false; + } + remainingAccountBalance = initiateWithdraw(amountToWithdraw, availableAccountBalance); updateSuccess = updateAvailableAccountBalance(user_id, remainingAccountBalance); if( updateSuccess ) { @@ -91,7 +97,7 @@ bool withdrawSpecificAmount(int user_id, float amountToWithdraw) { return false; } -int main(){ - withdraw(1234); - return 1; -} \ No newline at end of file +// int main(){ +// withdraw(1234); +// return 1; +// } \ No newline at end of file diff --git a/src/withdrawMoney.h b/src/withdrawMoney.h index 752c154..2303078 100644 --- a/src/withdrawMoney.h +++ b/src/withdrawMoney.h @@ -4,6 +4,8 @@ #include #include +#define MAX_AMOUNT 10000 + bool withdraw(int user_id); float initiateWithdraw(float amountToWithdraw, float availableAccountBalance); void notifyCustomer(float amountToWithdraw, float remainingAccountBalance, int user_id);