Browse Source

add CustomerData file

remotes/origin/feature/send-money
fdai6618 2 years ago
parent
commit
ea15eb3d0e
  1. 6
      src/CustomerData.txt
  2. BIN
      src/a.exe
  3. 23
      src/sendmoney.c
  4. 3
      src/sendmoney.h

6
src/CustomerData.txt

@ -0,0 +1,6 @@
1234=example
ID=1234
forename=Max
Surname=Mustermann
password=example
balance=23

BIN
src/a.exe

23
src/sendmoney.c

@ -1,17 +1,12 @@
#include "sendmoney.h" #include "sendmoney.h"
int main() int main()
{ {
SendMoney(); SendMoney();
return 0;
} }
// hier wird der Kontozustand zurückgegeben
double getAvailableAccountBalance(double balance) double getAvailableAccountBalance(double balance)
{ {
return balance;
return balance;
} }
// hier wird geprüft ob das Kontonummer gultig ist // hier wird geprüft ob das Kontonummer gultig ist
@ -21,7 +16,7 @@ bool checkAccount(int accountNumber)
return (accountNumber >= 1000000 && accountNumber <= 9999999); return (accountNumber >= 1000000 && accountNumber <= 9999999);
} }
// hier wird amount zurückgegeben // hier wird amount zurückgegeben
float getAmount(float amountToSend)
double getAmount(double amountToSend)
{ {
return amountToSend; return amountToSend;
@ -61,14 +56,16 @@ void getReceiverAccountNumber()
void SendMoney() void SendMoney()
{ {
float amountToSend;
double balance = 1000;
double amountToSend;
double length = 21;
int counter = 0; int counter = 0;
printf("Bitte geben Sie the Amount:"); printf("Bitte geben Sie the Amount:");
scanf("%e", &amountToSend);
float amount = getAmount(amountToSend);
scanf("%lf", &amountToSend);
double amount = getAmount(amountToSend);
int receiverAccountNumber; int receiverAccountNumber;
float availableAccountBalance = getAvailableAccountBalance(balance);
double availableAccountBalance = getAvailableAccountBalance(length);
printf("%lf", availableAccountBalance);
char tryDifferentAmount; char tryDifferentAmount;
@ -112,5 +109,5 @@ void initiateMoneyTransfer(float amountToSend)
{ {
printf("Money transferred \n"); printf("Money transferred \n");
printf("You have succesfully sent %1.f\n ", amountToSend);
printf("You have succesfully sent %lf\n ", amountToSend);
} }

3
src/sendmoney.h

@ -7,7 +7,8 @@
bool checkAccount(int accountNumber); bool checkAccount(int accountNumber);
double getAvailableAccountBalance(double balance); double getAvailableAccountBalance(double balance);
float getAmount(float amountToSend);
double getAmount(double amountToSend);
void getReceiverAccountNumber(); void getReceiverAccountNumber();
void SendMoney(); void SendMoney();
void initiateMoneyTransfer(float amountToSend); void initiateMoneyTransfer(float amountToSend);

Loading…
Cancel
Save