diff --git a/src/CustomerData.txt b/src/CustomerData.txt new file mode 100644 index 0000000..b01179a --- /dev/null +++ b/src/CustomerData.txt @@ -0,0 +1,6 @@ +1234=example +ID=1234 +forename=Max +Surname=Mustermann +password=example +balance=23 diff --git a/src/a.exe b/src/a.exe index ea288ef..9ac4170 100644 Binary files a/src/a.exe and b/src/a.exe differ diff --git a/src/sendmoney.c b/src/sendmoney.c index 12ab702..cdc75e5 100644 --- a/src/sendmoney.c +++ b/src/sendmoney.c @@ -1,17 +1,12 @@ #include "sendmoney.h" - int main() { SendMoney(); - - return 0; } - -// hier wird der Kontozustand zurückgegeben double getAvailableAccountBalance(double balance) { - return balance; + return balance; } // hier wird geprüft ob das Kontonummer gultig ist @@ -21,7 +16,7 @@ bool checkAccount(int accountNumber) return (accountNumber >= 1000000 && accountNumber <= 9999999); } // hier wird amount zurückgegeben -float getAmount(float amountToSend) +double getAmount(double amountToSend) { return amountToSend; @@ -61,14 +56,16 @@ void getReceiverAccountNumber() void SendMoney() { - float amountToSend; - double balance = 1000; + double amountToSend; + double length = 21; int counter = 0; printf("Bitte geben Sie the Amount:"); - scanf("%e", &amountToSend); - float amount = getAmount(amountToSend); + scanf("%lf", &amountToSend); + double amount = getAmount(amountToSend); int receiverAccountNumber; - float availableAccountBalance = getAvailableAccountBalance(balance); + double availableAccountBalance = getAvailableAccountBalance(length); + + printf("%lf", availableAccountBalance); char tryDifferentAmount; @@ -112,5 +109,5 @@ void initiateMoneyTransfer(float amountToSend) { printf("Money transferred \n"); - printf("You have succesfully sent %1.f\n ", amountToSend); + printf("You have succesfully sent %lf\n ", amountToSend); } diff --git a/src/sendmoney.h b/src/sendmoney.h index aa8cea8..e4cc9e7 100644 --- a/src/sendmoney.h +++ b/src/sendmoney.h @@ -7,7 +7,8 @@ bool checkAccount(int accountNumber); double getAvailableAccountBalance(double balance); -float getAmount(float amountToSend); + +double getAmount(double amountToSend); void getReceiverAccountNumber(); void SendMoney(); void initiateMoneyTransfer(float amountToSend);