diff --git a/src/a.exe b/src/a.exe new file mode 100644 index 0000000..5f854a6 Binary files /dev/null and b/src/a.exe differ diff --git a/src/sendmoney.c b/src/sendmoney.c index 021830f..3c3de6b 100644 --- a/src/sendmoney.c +++ b/src/sendmoney.c @@ -1,5 +1,12 @@ #include "sendmoney.h" +int main() +{ + SendMoney(); + + return 0; +} + // hier wird der Kontozustand zurückgegeben double getAvailableAccountBalance(double balance) { @@ -46,7 +53,7 @@ void getReceiverAccountNumber() else { - printf("KontoNummer Gültig"); + printf("KontoNummer Gueltig"); } } @@ -56,6 +63,7 @@ void SendMoney() float amountToSend; double balance = 1000; + int counter = 0; printf("Bitte geben Sie the Amount:"); scanf("%e", &amountToSend); float amount = getAmount(amountToSend); @@ -84,14 +92,22 @@ void SendMoney() scanf("%s", &tryDifferentAmount); - if (tryDifferentAmount == 'Y' || tryDifferentAmount == 'y') + while ((tryDifferentAmount == 'Y' || tryDifferentAmount == 'y') && counter <= 2) { - amount = getAmount(amountToSend); - } - else - { - printf("Fehler"); + + printf("Bitte geben Sie einen Gueltigen Amount:\n"); + scanf("%d", &amountToSend); + counter++; } + + /* if (tryDifferentAmount == 'Y' || tryDifferentAmount == 'y') + { + amount = getAmount(amountToSend); + } + else + { + printf("Fehler"); + }*/ } } } diff --git a/src/sendmoney.exe b/src/sendmoney.exe new file mode 100644 index 0000000..6279b89 Binary files /dev/null and b/src/sendmoney.exe differ diff --git a/src/sendmoney.h b/src/sendmoney.h index 4441313..8a8a008 100644 --- a/src/sendmoney.h +++ b/src/sendmoney.h @@ -9,5 +9,6 @@ bool checkAccount(int accountNumber); double getAvailableAccountBalance(double balance); float getAmount(float amountToSend); void getReceiverAccountNumber(); +void SendMoney(); #endif // SENDMONEY_H