public static void Main() { Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; var deposit = new DepositAccount(customer: Customer.Company, balance: 200, interestRate: 20); Console.WriteLine("Deposit account's Interest Amount: {0}", deposit.CalculateInterestAmount(months: 6)); // when balance is more than 1000 deposit.Deposit(900m); Console.WriteLine("Deposit account's Interest Amount: {0}\n", deposit.CalculateInterestAmount(months: 6)); // individual var loanIndividual = new LoanAccount(customer: Customer.Individual, balance: 100, interestRate: 15); Console.WriteLine("Loan individual account's Interest Amount: {0}", loanIndividual.CalculateInterestAmount(months: 3)); Console.WriteLine("Loan individual account's Interest Amount: {0}\n", loanIndividual.CalculateInterestAmount(months: 5)); // company var loanCompany = new LoanAccount(customer: Customer.Company, balance: 100, interestRate: 15); Console.WriteLine("Loan company account's Interest Amount: {0}", loanCompany.CalculateInterestAmount(months: 2)); Console.WriteLine("Loan company account's Interest Amount: {0}\n", loanCompany.CalculateInterestAmount(months: 5)); // individual var mortIndividual = new MortgageAccount(customer: Customer.Individual, balance: 350, interestRate: 5); Console.WriteLine("Mortgage individual account's Interest Amount: {0}", mortIndividual.CalculateInterestAmount(months: 7)); Console.WriteLine("Mortgage individual account's Interest Amount: {0}\n", mortIndividual.CalculateInterestAmount(months: 8)); // company var mortCompany = new MortgageAccount(customer: Customer.Company, balance: 20000, interestRate: 15); Console.WriteLine("Mortgage company account's Interest Amount: {0}", mortCompany.CalculateInterestAmount(months: 10)); Console.WriteLine("Mortgage company account's Interest Amount: {0}\n", mortCompany.CalculateInterestAmount(months: 24)); }
static void Main() { Customer individual = new Individual("Some Individual"); Customer company = new Company("Some Company"); Customer otherIndividual = new Individual("SomeOther Individual"); Customer otherCompany = new Company("SomeOther Company"); Account individualLoanAccount = new LoanAccount(individual, 2000, 2); decimal interest = individualLoanAccount.CalculateInterestAmount(5); Console.WriteLine(interest); Account companyMortgageAccount = new MortgageAccount(company, 20000, 3); interest = companyMortgageAccount.CalculateInterestAmount(5); Console.WriteLine(interest); Account depositIndividualAccount = new DepositAccount(individual, 900, 1.5M); depositIndividualAccount.Deposit(1000); interest = depositIndividualAccount.CalculateInterestAmount(2); Console.WriteLine(interest); }
public static void Main() { IndividualCustomer pesho = new IndividualCustomer("Pesho"); CompanyCustomer telerik = new CompanyCustomer("Telerik"); LoanAccount loanAcc = new LoanAccount(pesho, 250, 25); DepositAccount depositAcc = new DepositAccount(telerik, 10000, 20); loanAcc.DepositAmount(100); Console.WriteLine(loanAcc.Balance); depositAcc.WithdrawAmount(5000); Console.WriteLine(depositAcc.Balance); Console.WriteLine(depositAcc.CalculateInterestAmount(12)); }
static void Main() { IndividualCustomer inCustomerPesho = new IndividualCustomer("Pesho"); CompanyCustomer comCustomerGoshoOOD = new CompanyCustomer("Gosho OOD"); DepositAccount peshoDepositAcc = new DepositAccount(inCustomerPesho,500m); LoanAccount goshoLoanAcc = new LoanAccount(comCustomerGoshoOOD, 600m); MortgageAccount goshoMorAcc = new MortgageAccount(comCustomerGoshoOOD,550m); Console.WriteLine("\tPesho acc info"); Console.WriteLine(); Console.WriteLine("Balance in the begining: {0}",peshoDepositAcc.Balance); peshoDepositAcc.DepositAmount(6000m); Console.WriteLine("Balance after deposit: {0}",peshoDepositAcc.Balance); peshoDepositAcc.WithdrawAmount(100m); Console.WriteLine("Balance after withdraw: {0}",peshoDepositAcc.Balance); Console.WriteLine("Interest Amount: " + peshoDepositAcc.CalculateInterestAmount(50)); Console.WriteLine(); Console.WriteLine(new string('-',30)); Console.WriteLine(); Console.WriteLine("\t Gosho loan acc info"); Console.WriteLine(); Console.WriteLine("Balance in the begining: {0}",goshoLoanAcc.Balance); goshoLoanAcc.DepositAmount(50000m); Console.WriteLine("Balance after deposit: {0}",goshoLoanAcc.Balance); Console.WriteLine("Interest Amount: " + goshoLoanAcc.CalculateInterestAmount(25)); Console.WriteLine(); Console.WriteLine(new string('-', 30)); Console.WriteLine(); Console.WriteLine("\t Gosho Mortgage acc info"); Console.WriteLine(); Console.WriteLine("Balance in the begining: {0}",goshoMorAcc.Balance); goshoMorAcc.DepositAmount(50); Console.WriteLine("Balance after deposit: {0}",goshoMorAcc.Balance); Console.WriteLine("Interest Amount: " + goshoMorAcc.CalculateInterestAmount(5)); }