Browse Source

implement sendMoney methode

remotes/origin/feature/send-money
fdai6618 2 years ago
parent
commit
b98932b197
  1. 46
      src/sendmoney.c

46
src/sendmoney.c

@ -49,3 +49,49 @@ void getReceiverAccountNumber()
printf("KontoNummer Gültig");
}
}
// Methode send()
void SendMoney()
{
float amountToSend;
double balance = 1000;
printf("Bitte geben Sie the Amount:");
scanf("%e", &amountToSend);
float amount = getAmount(amountToSend);
int receiverAccountNumber;
float availableAccountBalance = getAvailableAccountBalance(balance);
char tryDifferentAmount;
if (amountToSend < 0)
{
printf("Bitte geben Sie einen Gültigen Amount");
}
else
{
if (amountToSend <= availableAccountBalance)
{
getReceiverAccountNumber();
}
else
{
printf("You don't have a sufficient money to transfer\n");
printf("try with a different amount? [y]: Yes, any Other key: exit:");
scanf("%s", &tryDifferentAmount);
if (tryDifferentAmount == 'Y' || tryDifferentAmount == 'y')
{
amount = getAmount(amountToSend);
}
else
{
printf("Fehler");
}
}
}
}
Loading…
Cancel
Save