|
@ -1,13 +1,18 @@ |
|
|
#include "withdrawMoney.h" |
|
|
#include "withdrawMoney.h" |
|
|
|
|
|
|
|
|
void initiateWithdraw(float amountToWithdraw, float availableAccountBalance) { |
|
|
void initiateWithdraw(float amountToWithdraw, float availableAccountBalance) { |
|
|
|
|
|
char returnToHomeInput = NULL; |
|
|
float remainingAccountBalance = (availableAccountBalance - amountToWithdraw); |
|
|
float remainingAccountBalance = (availableAccountBalance - amountToWithdraw); |
|
|
|
|
|
|
|
|
updateAccountBalance(remainingAccountBalance); |
|
|
updateAccountBalance(remainingAccountBalance); |
|
|
printf("You have successfully withdrawn %f €.\n", amountToWithdraw); |
|
|
printf("You have successfully withdrawn %f €.\n", amountToWithdraw); |
|
|
printf("Remaining account balance: %f €\n\n", remainingAccountBalance); |
|
|
printf("Remaining account balance: %f €\n\n", remainingAccountBalance); |
|
|
printf("Press any key to return to home page: "); |
|
|
printf("Press any key to return to home page: "); |
|
|
// go to home page |
|
|
|
|
|
|
|
|
scanf("%c", &returnToHomeInput); |
|
|
|
|
|
|
|
|
|
|
|
if (returnToHomeInput) { |
|
|
|
|
|
showAllMenuEntries(); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void withdraw() { |
|
|
void withdraw() { |
|
@ -29,7 +34,7 @@ void withdraw() { |
|
|
withdraw(); |
|
|
withdraw(); |
|
|
} |
|
|
} |
|
|
else { |
|
|
else { |
|
|
// return to home page |
|
|
|
|
|
|
|
|
showAllMenuEntries(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|