|
|
@ -29,10 +29,16 @@ bool withdraw(int user_id) { |
|
|
|
float remainingAccountBalance; |
|
|
|
bool updateSuccess = false; |
|
|
|
|
|
|
|
float availableAccountBalance = getAvailableAccountBalance(user_id); |
|
|
|
|
|
|
|
printf("\n:.:.:.:.:.:"); |
|
|
|
printf("\nYour current balance is %.2f.\n",availableAccountBalance); |
|
|
|
printf(":.:.:.:.:.:\n"); |
|
|
|
|
|
|
|
printf("Enter amount to withdraw: "); |
|
|
|
scanf("%f", &amountToWithdraw); |
|
|
|
|
|
|
|
float availableAccountBalance = getAvailableAccountBalance(user_id); |
|
|
|
|
|
|
|
if (amountToWithdraw > 0) { |
|
|
|
if (amountToWithdraw <= availableAccountBalance) { |
|
|
|
remainingAccountBalance = initiateWithdraw(amountToWithdraw, availableAccountBalance); |
|
|
|