static void Main() { DepositAccount depositAccount = new DepositAccount(new Customer("Pesho", "individual"), 1200m, 10m); DepositAccount companyDepositAccount = new DepositAccount(new Customer("Goshos", "company"), 160000m, 8m); LoanAccount loanAccount = new LoanAccount(new Customer("Gosho", "individual"), 8000m, 12m); MortgageAccount morgageAccount = new MortgageAccount(new Customer("Peshovi", "company"), 12000m, 16m); Console.WriteLine("Deposit balanse: " + depositAccount.Balance); depositAccount.Deposit(1000); Console.WriteLine("After deposit 1000: " + depositAccount.Balance); depositAccount.Withdraw(1200); Console.WriteLine("After withdraw 1200: " + depositAccount.Balance); Console.WriteLine(); Console.WriteLine("Loan balanse: " + loanAccount.Balance); loanAccount.Deposit(1000); Console.WriteLine("After deposit 1000: " + loanAccount.Balance); Console.WriteLine(); Console.WriteLine("Morgage balanse: " + morgageAccount.Balance); morgageAccount.Deposit(1000); Console.WriteLine("After deposit 1000: " + morgageAccount.Balance); Console.WriteLine(); Console.WriteLine("Diderent interest calculations: "); Console.WriteLine(depositAccount.CalculateInterest(5)); Console.WriteLine(depositAccount.CalculateInterest(5)); Console.WriteLine(loanAccount.CalculateInterest(3)); Console.WriteLine(loanAccount.CalculateInterest(4)); Console.WriteLine(morgageAccount.CalculateInterest(6)); Console.WriteLine(morgageAccount.CalculateInterest(7)); Console.WriteLine(companyDepositAccount.CalculateInterest(12)); Console.WriteLine(companyDepositAccount.CalculateInterest(13)); }
static void Main() { Console.WriteLine("DEPOSIT ACCOUNT"); DepositAccount depositAccount = new DepositAccount(Customer.Companies, 5000.50m, 4.5m); Console.WriteLine(depositAccount.InterestRateForAPeriodCalculation(5)); Console.WriteLine(depositAccount.Balance); depositAccount.Deposit(1000m); Console.WriteLine(depositAccount.Balance); Console.WriteLine(depositAccount.InterestRateForAPeriodCalculation(5)); depositAccount.Widthraw(5500m); Console.WriteLine(depositAccount.Balance); Console.WriteLine(depositAccount.InterestRateForAPeriodCalculation(5)); Console.WriteLine(); Console.WriteLine("LOAN ACCOUNT"); LoanAccount loanAccount = new LoanAccount(Customer.Individual, 5000, 10); Console.WriteLine(loanAccount.InterestRateForAPeriodCalculation(3)); loanAccount.Customer = Customer.Companies; Console.WriteLine(loanAccount.InterestRateForAPeriodCalculation(3)); Console.WriteLine(); Console.WriteLine("MORTGAGE ACCOUNT"); MortgageAccount mortgageAccount = new MortgageAccount(Customer.Companies, 4000m, 5.45m); Console.WriteLine(mortgageAccount.InterestRateForAPeriodCalculation(6)); }
static void Main(string[] args) { Accounts loan = new Loan(7000, new Companies("Nike"), 0.09); loan.Deposit(600); Accounts deposit = new DepositAccount(1500, new IndividualCustomer("Gosho"), 0.12); deposit.Deposit(200); Accounts mortgage = new Mortgage(5000, new Companies("Puma"), 0.12); mortgage.Deposit(6000); Console.WriteLine(loan.CalculateRate(3)); Console.WriteLine(mortgage.CalculateRate(15)); Console.WriteLine(deposit.CalculateRate(10)); }
static void Main(string[] args) { Accounts loan = new Loan(7000, new Companies("Nike"), 0.09); loan.Deposit(600); Accounts deposit = new DepositAccount(1500, new IndividualCustomer("Gosho"), 0.12); deposit.Deposit(200); Accounts mortgage = new Mortgage(5000, new Companies("Puma"), 0.12); mortgage.Deposit(6000); Console.WriteLine(loan.CalculateRate(3)); Console.WriteLine(mortgage.CalculateRate(15)); Console.WriteLine(deposit.CalculateRate(10)); }
static void Main(string[] args) { var me = new Customer("Alex", CustomerType.Individual); var acc = new DepositAccount(me, 2000, 0.2); acc.Deposit(500); acc.Withdraw(600); Console.WriteLine("Balance: {0}", acc.Balance); Console.WriteLine("Interest: {0}", acc.CalculateInterest(15)); Console.WriteLine("========"); var loanAcc = new LoanAccount(me, 3000, 0.4); try { loanAcc.Withdraw(500); } catch (InvalidOperationException ex) { Console.WriteLine(ex.Message); } }
static void Main(string[] args) { var me = new Customer("Alex", CustomerType.Individual); var acc = new DepositAccount(me, 2000, 0.2); acc.Deposit(500); acc.Withdraw(600); Console.WriteLine("Balance: {0}", acc.Balance); Console.WriteLine("Interest: {0}", acc.CalculateInterest(15)); Console.WriteLine("========"); var loanAcc = new LoanAccount(me, 3000, 0.4); try { loanAcc.Withdraw(500); } catch (InvalidOperationException ex) { Console.WriteLine(ex.Message); } }