Browse Source

modified SendMoney method

remotes/origin/feature/send-money
fdai6618 2 years ago
parent
commit
f76fd87ce8
  1. BIN
      src/a.exe
  2. 22
      src/sendmoney.c
  3. BIN
      src/sendmoney.exe
  4. 1
      src/sendmoney.h

BIN
src/a.exe

22
src/sendmoney.c

@ -1,5 +1,12 @@
#include "sendmoney.h" #include "sendmoney.h"
int main()
{
SendMoney();
return 0;
}
// hier wird der Kontozustand zurückgegeben // hier wird der Kontozustand zurückgegeben
double getAvailableAccountBalance(double balance) double getAvailableAccountBalance(double balance)
{ {
@ -46,7 +53,7 @@ void getReceiverAccountNumber()
else else
{ {
printf("KontoNummer Gültig");
printf("KontoNummer Gueltig");
} }
} }
@ -56,6 +63,7 @@ void SendMoney()
float amountToSend; float amountToSend;
double balance = 1000; double balance = 1000;
int counter = 0;
printf("Bitte geben Sie the Amount:"); printf("Bitte geben Sie the Amount:");
scanf("%e", &amountToSend); scanf("%e", &amountToSend);
float amount = getAmount(amountToSend); float amount = getAmount(amountToSend);
@ -84,14 +92,22 @@ void SendMoney()
scanf("%s", &tryDifferentAmount); scanf("%s", &tryDifferentAmount);
if (tryDifferentAmount == 'Y' || tryDifferentAmount == 'y')
while ((tryDifferentAmount == 'Y' || tryDifferentAmount == 'y') && counter <= 2)
{
printf("Bitte geben Sie einen Gueltigen Amount:\n");
scanf("%d", &amountToSend);
counter++;
}
/* if (tryDifferentAmount == 'Y' || tryDifferentAmount == 'y')
{ {
amount = getAmount(amountToSend); amount = getAmount(amountToSend);
} }
else else
{ {
printf("Fehler"); printf("Fehler");
}
}*/
} }
} }
} }

BIN
src/sendmoney.exe

1
src/sendmoney.h

@ -9,5 +9,6 @@ bool checkAccount(int accountNumber);
double getAvailableAccountBalance(double balance); double getAvailableAccountBalance(double balance);
float getAmount(float amountToSend); float getAmount(float amountToSend);
void getReceiverAccountNumber(); void getReceiverAccountNumber();
void SendMoney();
#endif // SENDMONEY_H #endif // SENDMONEY_H
Loading…
Cancel
Save