Browse Source

Create customer interface for deposit

remotes/origin/feature/transfer-money
fdlt3817 2 years ago
parent
commit
b0b991e856
  1. 4
      src/depositMoney.c

4
src/depositMoney.c

@ -26,11 +26,12 @@ bool depositMoney(int customerID){
float amountToDeposit = 0; float amountToDeposit = 0;
printf("\nPlease enter the amount you want to deposit: ");
scanf("%f", &amountToDeposit); scanf("%f", &amountToDeposit);
if(amountToDeposit>0 && amountToDeposit>MINIMUM_DEPOSIT_AMOUNT){ if(amountToDeposit>0 && amountToDeposit>MINIMUM_DEPOSIT_AMOUNT){
//InitiateDepositMoney(amountToDeposit,availableAccountBalance); //InitiateDepositMoney(amountToDeposit,availableAccountBalance);
if(updateAvailableAccountBalance(customerID, amountToDeposit, true)==0){
if(updateAvailableAccountBalance(customerID, availableAccountBalance+amountToDeposit)==0){
printf("\nYou have successfully deposited %.2f. New account balance is %.2f", amountToDeposit, availableAccountBalance+amountToDeposit); printf("\nYou have successfully deposited %.2f. New account balance is %.2f", amountToDeposit, availableAccountBalance+amountToDeposit);
askToTryAgain(false); askToTryAgain(false);
return true; return true;
@ -47,4 +48,5 @@ bool depositMoney(int customerID){
askToTryAgain(true); askToTryAgain(true);
return false; //invalid input return false; //invalid input
} }
return false;
} }
Loading…
Cancel
Save