Browse Source

implement methode getReceiverAccountNumber

remotes/origin/feature/send-money
fdai6618 2 years ago
parent
commit
0aa4b90f7a
  1. 30
      src/sendmoney.c
  2. 1
      src/sendmoney.h

30
src/sendmoney.c

@ -19,3 +19,33 @@ float getAmount(float amountToSend)
return amountToSend; return amountToSend;
} }
// hier die wird die Kontonummer eingegeben und getestet
void getReceiverAccountNumber()
{
int accountNumber;
printf("Enter The account in Which you want to transfer the money:");
scanf("%d", &accountNumber);
int counter = 0;
while (checkAccount(accountNumber) == false && counter <= 2)
{
printf("Bitte geben Sie einen Gueltigen Kontonummer:\n");
scanf("%d", &accountNumber);
counter++;
}
if (checkAccount(accountNumber) == false)
{
printf("Konto ist ungultig\n");
printf("Programm wird beendet");
exit(0);
}
else
{
printf("KontoNummer Gültig");
}
}

1
src/sendmoney.h

@ -8,4 +8,5 @@
bool checkAccount(int accountNumber); bool checkAccount(int accountNumber);
double getAvailableAccountBalance(double balance); double getAvailableAccountBalance(double balance);
float getAmount(float amountToSend); float getAmount(float amountToSend);
void getReceiverAccountNumber();
#endif // SENDMONEY_H #endif // SENDMONEY_H
Loading…
Cancel
Save