Beispiel #1
0
        public static void Withdraw(Accounts accounts, double amount)
        {
            Console.WriteLine("there are : " + accounts.GetAmount() + " of money from account " + accounts.GetAccountId());
            double money = accounts.GetAmount() - amount;

            accounts.SetAmount(money);
            Console.WriteLine("there are : " + accounts.GetAmount() + " of money left");
        }
Beispiel #2
0
        public static void MoneyTransfer(Accounts DebitAccount, Accounts CreditAccount, double amount)
        {
            Console.WriteLine("Money on debit account before transfer: " + DebitAccount.GetAmount());
            Console.WriteLine("Money on credit account before transfer: " + CreditAccount.GetAmount());
            double money = DebitAccount.GetAmount() - amount;

            DebitAccount.SetAmount(money);
            CreditAccount.SetAmount(CreditAccount.GetAmount() + amount);
            Console.WriteLine("Money on debit account after transfer: " + DebitAccount.GetAmount());
            Console.WriteLine("Money on credit account after transfer: " + CreditAccount.GetAmount());
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            Authentification.OpenApplication();

            Clients Julie = new Clients("Julie", 1234);
            Clients Jule  = new Clients("Jule", 1234);

            Accounts JulieAccount1 = Julie.CreateAccount();
            Accounts JulieAccount2 = Julie.CreateAccount();

            Accounts JuleAccount1 = Jule.CreateAccount();
            Accounts JuleAccount2 = Jule.CreateAccount();

            //Accounts accounts = new Accounts(Jule);
            JuleAccount1.SetAmount(3000);
            JuleAccount2.SetAmount(6000);
            JulieAccount1.SetAmount(8000);
            JulieAccount2.SetAmount(2000);


            Transaction.MoneyTransfer(JuleAccount1, JulieAccount1, 100);
            Transaction.Withdraw(JulieAccount2, 500);
        }