From 4b96f96df8ff952b1cd2629917d03ed087f1ce6e Mon Sep 17 00:00:00 2001 From: fdlt3817 Date: Fri, 10 Feb 2023 10:03:46 +0100 Subject: [PATCH] Create show balance function --- src/sendmoney.c | 22 +++++++++++++++++++--- src/sendmoney.h | 2 ++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/sendmoney.c b/src/sendmoney.c index 0980976..393155d 100644 --- a/src/sendmoney.c +++ b/src/sendmoney.c @@ -2,11 +2,21 @@ #include "depositMoney.c" #include "withdrawMoney.c" +void showBalance(int customerID){ + float balance=getAvailableAccountBalance(customerID); + printf("\n:.:.:.:.:.:"); + printf("\nYour current balance is %.2f.\n",balance); + printf(":.:.:.:.:.:\n"); +} + + bool sendMoney(int customerID){ float availableAccountBalance=getAvailableAccountBalance(customerID); float amountToSend; int recID; - printf("\nYou have %.2f€ in your account. How much would you like to send?\n",availableAccountBalance); + char c; + showBalance(customerID); + printf("\nHow much would you like to send?\n"); scanf("%f",&amountToSend); if(amountToSend>0 && amountToSend #include +#define TRANSFER_FEE 0.8 +void showBalance(int customerID); bool sendMoney(int customerID); #endif // SENDMONEY_H