Browse Source

Add missing parameter for function

remotes/origin/feature/withdraw-money-system
Shivam Chaudhary 2 years ago
parent
commit
49f065ce3f
  1. 8
      src/withdrawMoney.c
  2. 2
      src/withdrawMoney.h

8
src/withdrawMoney.c

@ -15,11 +15,11 @@ void initiateWithdraw(float amountToWithdraw, float availableAccountBalance) {
}
}
void withdraw() {
void withdraw(int user_id) {
float amountToWithdraw;
char tryDifferentAmount;
float availableAccountBalance = getAvailableAccountBalance();
float availableAccountBalance = getAvailableAccountBalance(user_id);
printf("Enter amount to withdraw: ");
scanf("%f", &amountToWithdraw);
@ -31,7 +31,7 @@ void withdraw() {
printf("You don't have sufficient money to withdraw. Do you want to try different amount?\n[y]: Yes, any other key : exit");
scanf(" %c", &tryDifferentAmount);
if (tryDifferentAmount == 'Y' || tryDifferentAmount == 'y') {
withdraw();
withdraw(user_id);
}
else {
showAllMenuEntries();
@ -40,6 +40,6 @@ void withdraw() {
}
else {
printf("Invalid Input! Please try again.\n");
withdraw();
withdraw(user_id);
}
}

2
src/withdrawMoney.h

@ -1,4 +1,4 @@
#include <stdio.h>
void withdraw();
void withdraw(int user_id);
void initiateWithdraw(float amountToWithdraw, float availableAccountBalance);
Loading…
Cancel
Save