|
@ -41,6 +41,12 @@ bool withdraw(int user_id) { |
|
|
|
|
|
|
|
|
if (amountToWithdraw > 0) { |
|
|
if (amountToWithdraw > 0) { |
|
|
if (amountToWithdraw <= availableAccountBalance) { |
|
|
if (amountToWithdraw <= availableAccountBalance) { |
|
|
|
|
|
|
|
|
|
|
|
if(amountToWithdraw>MAX_AMOUNT){ |
|
|
|
|
|
printf("\nYou cannot withdraw more than %d€.",MAX_AMOUNT); |
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
remainingAccountBalance = initiateWithdraw(amountToWithdraw, availableAccountBalance); |
|
|
remainingAccountBalance = initiateWithdraw(amountToWithdraw, availableAccountBalance); |
|
|
updateSuccess = updateAvailableAccountBalance(user_id, remainingAccountBalance); |
|
|
updateSuccess = updateAvailableAccountBalance(user_id, remainingAccountBalance); |
|
|
if( updateSuccess ) { |
|
|
if( updateSuccess ) { |
|
@ -91,7 +97,7 @@ bool withdrawSpecificAmount(int user_id, float amountToWithdraw) { |
|
|
return false; |
|
|
return false; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
int main(){ |
|
|
|
|
|
withdraw(1234); |
|
|
|
|
|
return 1; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// int main(){ |
|
|
|
|
|
// withdraw(1234); |
|
|
|
|
|
// return 1; |
|
|
|
|
|
// } |