Пример #1
0
        static void Main()
        {
            Customer ivanCustomer = new Customer("Ivan", "Petrov", CustomerType.Individual);
            //Customer ivanCustomer = new Customer("Ivan", CustomerType.Individual);
            Deposit ivanDeposit = new Deposit(ivanCustomer, 0.5m, 6000);

            ivanDeposit.Withdraw(100);
            Console.WriteLine(ivanDeposit.Balance);
            Console.WriteLine(ivanDeposit.CalculateRemunerate(12));

            Console.WriteLine(ivanCustomer);
            Console.WriteLine(ivanDeposit);

            Loan ivanLoan = new Loan(ivanCustomer, 1.2m, 2500);

            Console.WriteLine(ivanLoan.Balance);
            Mortgage ivanMortgage = new Mortgage(ivanCustomer, 0.3m, 80000);

            List<Account> accountsList = new List<Account>();

            Bank ktb = new Bank("KTB", accountsList);
            ktb.AddAccount(ivanDeposit);
            ktb.AddAccount(ivanLoan);
            ktb.AddAccount(ivanMortgage);

            Console.WriteLine(ktb);

            Console.WriteLine(ivanLoan.CalculateRemunerate(4));
            Console.WriteLine(ivanMortgage.CalculateRemunerate(8));

            Console.WriteLine(ivanLoan);
        }
Пример #2
0
 public Deposit(Customer owner, decimal interestRate, decimal initialBalance)
     : base(owner, interestRate, initialBalance)
 {
 }
Пример #3
0
 public Mortgage(Customer owner, decimal interestRate, decimal initialBalance)
     : base(owner, interestRate, initialBalance)
 {
 }
Пример #4
0
        private Customer owner; // проблемът го оправих като смених тук customer с owner

        #endregion Fields

        #region Constructors

        //Ако началният баланс не е указан, по подразбиране е 0;
        public Account(Customer owner, decimal interestRate,  decimal initialBalance = 0)
        {
            this.Owner = owner; // проблемът го оправих като смених тук customer с owner
            this.Balance = initialBalance;
            this.InterestRate = interestRate;
        }