From b0b991e85651897755637968cff44e7dcc240f43 Mon Sep 17 00:00:00 2001 From: fdlt3817 Date: Tue, 7 Feb 2023 15:10:12 +0100 Subject: [PATCH] Create customer interface for deposit --- src/depositMoney.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/depositMoney.c b/src/depositMoney.c index 016b92f..093cc34 100644 --- a/src/depositMoney.c +++ b/src/depositMoney.c @@ -26,11 +26,12 @@ bool depositMoney(int customerID){ float amountToDeposit = 0; + printf("\nPlease enter the amount you want to deposit: "); scanf("%f", &amountToDeposit); if(amountToDeposit>0 && amountToDeposit>MINIMUM_DEPOSIT_AMOUNT){ //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); askToTryAgain(false); return true; @@ -47,4 +48,5 @@ bool depositMoney(int customerID){ askToTryAgain(true); return false; //invalid input } + return false; } \ No newline at end of file