|
|
@ -3,10 +3,35 @@ int main() |
|
|
|
{ |
|
|
|
SendMoney(); |
|
|
|
} |
|
|
|
double getAvailableAccountBalance(double balance) |
|
|
|
double getAvailableAccountBalance(int length) |
|
|
|
{ |
|
|
|
double availableBalance; |
|
|
|
|
|
|
|
return balance; |
|
|
|
FILE *fp; |
|
|
|
fp = fopen("CustomerData.txt", "r"); |
|
|
|
|
|
|
|
if (fp == 0) |
|
|
|
{ |
|
|
|
printf("Error: customer data file cannot be opened!\n"); |
|
|
|
return 0; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
|
|
|
|
char line[length]; |
|
|
|
|
|
|
|
while (fgets(line, sizeof line, fp) != NULL) |
|
|
|
{ |
|
|
|
if (sscanf(line, "balance=%lf", &availableBalance) == 1) |
|
|
|
{ |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
fclose(fp); |
|
|
|
printf("your balance is : %lf\n", availableBalance); |
|
|
|
} |
|
|
|
|
|
|
|
return availableBalance; |
|
|
|
} |
|
|
|
|
|
|
|
// hier wird geprüft ob das Kontonummer gultig ist |
|
|
@ -48,7 +73,7 @@ void getReceiverAccountNumber() |
|
|
|
|
|
|
|
else |
|
|
|
{ |
|
|
|
printf("Kontonummer ist Gueltig"); |
|
|
|
printf("Kontonummer ist Gueltig\n"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -65,8 +90,6 @@ void SendMoney() |
|
|
|
int receiverAccountNumber; |
|
|
|
double availableAccountBalance = getAvailableAccountBalance(length); |
|
|
|
|
|
|
|
printf("%lf", availableAccountBalance); |
|
|
|
|
|
|
|
char tryDifferentAmount; |
|
|
|
|
|
|
|
if (amountToSend < 0) |
|
|
|