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