Пример #1
0
        static void Main(string[] args)
        {
            Account account = new Account("Onescu Oana Florentina", 10000);

            Console.WriteLine($"Account {account.Number} was created for {account.Owner} with {account.Balance} initial balance.");
            account.MakeWithdrawal(500, DateTime.Now, "Rent payment");
            Console.WriteLine(account.Balance);
            account.MakeDeposit(100, DateTime.Now, "Friend paid me back");
            Console.WriteLine(account.Balance);

            Console.WriteLine(account.CloseAccount());

            Console.WriteLine(account.GetAccountHistory());
        }
Пример #2
0
        private static void Main(string[] args)
        {
            Account newAccount1 = new Account("Zlata", "Zueva", new BaseGradation());

            newAccount1.PutMoney(12.90);
            Console.WriteLine(newAccount1.Bonus);
            newAccount1.PutMoney(50.10);
            newAccount1.TakeMoney(10.30);
            Console.WriteLine(newAccount1.Amount);
            Account newAccount2 = new Account(newAccount1.Number, "Alexander", "Azarov", newAccount1.Amount, newAccount1.Bonus, new GoldGradation());

            newAccount2.PutMoney(11);
            Account newAccount3 = newAccount2.CreateNewAccount(new PlatinumGradation());

            Console.WriteLine(newAccount3.Bonus);
            newAccount3.CloseAccount();
            Console.ReadLine();
        }
Пример #3
0
        static void Main(string[] args)
        {
            var account = new Account("Simion Marius");

            account.MakeDeposit(1000M, "Deposit creation");
            account.Withdrawal(200M, "Rent payment");
            account.MakeDeposit(1500M, "Salary");
            account.Withdrawal(2000M, "Products bought");     // should give an Insuficient funds error.
            account.AccountStatement();

            account.CloseAccount();

            account.MakeDeposit(1500M, "Closing test");       // should give an Account closed error.
            account.AccountStatement();



            var account1 = new Account("Simion Elena");

            account1.AccountStatement();
        }