From d98031e24b5e89dc5ea53f9d49c66c24b7318061 Mon Sep 17 00:00:00 2001 From: Shivam Chaudhary Date: Tue, 24 Jan 2023 20:54:12 +0100 Subject: [PATCH] Add initiateWithdraw function --- src/withdrawMoney.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/withdrawMoney.c b/src/withdrawMoney.c index dc3a2e9..4a2f1f5 100644 --- a/src/withdrawMoney.c +++ b/src/withdrawMoney.c @@ -1,4 +1,14 @@ -#include +#include "withdrawMoney.h" + +void initiateWithdraw(float amountToWithdraw, float availableAccountBalance) { + float remainingAccountBalance = (availableAccountBalance - amountToWithdraw); + + updateAccountBalance(remainingAccountBalance); + printf("You have successfully withdrawn %f €.\n", amountToWithdraw); + printf("Remaining account balance: %f €\n\n", remainingAccountBalance); + printf("Press any key to return to home page: "); + // go to home page +} void withdraw() { float amountToWithdraw;