|
|
@ -9,12 +9,21 @@ void showBalance(int customerID){ |
|
|
|
printf(":.:.:.:.:.:\n"); |
|
|
|
} |
|
|
|
|
|
|
|
void askToShowBalance(int customerID){ |
|
|
|
char c; |
|
|
|
printf("\nWould you like to see your remaining balance? [y] yes [any] no\n"); |
|
|
|
scanf(" %c",&c); |
|
|
|
if(c=='y' || c=='Y'){ |
|
|
|
showBalance(customerID); |
|
|
|
} |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
bool sendMoney(int customerID){ |
|
|
|
float availableAccountBalance=getAvailableAccountBalance(customerID); |
|
|
|
float amountToSend; |
|
|
|
int recID; |
|
|
|
char c; |
|
|
|
|
|
|
|
showBalance(customerID); |
|
|
|
printf("\nHow much would you like to send?\n"); |
|
|
|
scanf("%f",&amountToSend); |
|
|
@ -32,6 +41,7 @@ bool sendMoney(int customerID){ |
|
|
|
if(withdrawSpecificAmount(customerID, amountToSend)){ |
|
|
|
if(depositSpecificAmount(recID, amountToSend)){ |
|
|
|
printf("\nYou have successfuly transfered %.2f€ to [%d]",amountToSend,recID); |
|
|
|
askToShowBalance(customerID); |
|
|
|
return true; |
|
|
|
} |
|
|
|
else{ |
|
|
@ -44,11 +54,7 @@ bool sendMoney(int customerID){ |
|
|
|
printf("\nThis ID is not from a customer of our bank. A transfer fee of %.2f€ will be taken.\n", TRANSFER_FEE); |
|
|
|
if(withdrawSpecificAmount(customerID, amountToSend+TRANSFER_FEE)){ |
|
|
|
printf("\nYou have successfuly transfered %.2f€ to [%d]\n",amountToSend,recID); |
|
|
|
printf("\nWould you like to see your remaining balance? [y] yes [any] no\n"); |
|
|
|
scanf(" %c",&c); |
|
|
|
if(c=='y' || c=='Y'){ |
|
|
|
showBalance(customerID); |
|
|
|
} |
|
|
|
askToShowBalance(customerID); |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|