public static void Main() { LoanAccount lAccount = new LoanAccount("Gosho Goshev", CustomerTypes.individual, 23423, 3); DepositAccount dAccount = new DepositAccount("Company", CustomerTypes.company, 44321, 1.75m); MortgageAccount mAccount = new MortgageAccount("Any individual", CustomerTypes.individual, -234, 2.99m); Console.WriteLine("Loan account interest amont for 5 months: {0}", lAccount.InterestAmount(5)); Console.WriteLine("Deposit account interest amont for 3 months: {0}", dAccount.InterestAmount(3)); Console.WriteLine("Mortgage account interest amont for 7 months: {0}", mAccount.InterestAmount(7)); }
static void Main() { Console.WriteLine("Mortage account"); MortageAccount mort = new MortageAccount(CustumerType.Individual, 344, 0.006); double interAmount = mort.InterestAmount(12); Console.WriteLine("The interest amount for the first year is {0:0.00}%", interAmount * 100); Console.WriteLine(); Console.WriteLine("Loan account"); LoanAccount loan = new LoanAccount(CustumerType.Company, 1500, 0.009); interAmount = loan.InterestAmount(24); Console.WriteLine("The interest amount for the first two years is {0:0.00}%", interAmount * 100); Console.WriteLine(); Console.WriteLine("Deposit account"); DepositAccount deposit = new DepositAccount(CustumerType.Company, 1200, 0.007); interAmount = deposit.InterestAmount(6); Console.WriteLine("The interest amount for the first 6 monts is {0:0.00}%", interAmount * 100); Console.WriteLine(); }