Exemplo n.º 1
0
        public string Format(Account account)
        {
            if (account.Balance < 0)
            {
                return string.Format($"{account.GetType().Name} >>>>> {Environment.NewLine}" +
                                $"Overdraft: {account.Balance}{Environment.NewLine}" +
                                $"Montly interest rate:  {account.MonthlyInterestRate} {Environment.NewLine}" +
                                $"Interest rate for 24 months:   {account.InterestRate(24)}{Environment.NewLine}");
            }

                return string.Format($"{account.GetType().Name} >>>>> {Environment.NewLine}" +
                                $"Balance: {account.Balance}{Environment.NewLine}" +
                                $"Montly interest rate:  {account.MonthlyInterestRate} {Environment.NewLine}" +
                                $"Interest rate for 24 months:   {account.InterestRate(24)}{Environment.NewLine}");
        }
Exemplo n.º 2
0
        public void Print(Account account, BasicAccountPrint formatter)
        {
            var result = formatter.Format(account);

            Console.WriteLine(result);
        }