|
|
@ -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); |
|
|
|
} |