static void Main(string[] args) { Individual Celin = new Individual("Celin"); Company Dion = new Company("Dion"); Loan loanAcc = new Loan(Celin, 1, 7.5); Deposit depositAcc = new Deposit(Dion, 33000, 20); loanAcc.DepositAmount(100); Console.WriteLine(loanAcc.Balance); depositAcc.WithdrawAmount(5000); Console.WriteLine(depositAcc.Balance); Console.WriteLine(depositAcc.InterestAmount(12)); }
static void Main() { //most boring part of the code :))) Individual niki = new Individual("Nokolay Kostov", 020456432, "Sofia, ul. Gyueshevo", "8243567823"); Company telerik = new Company("Telerik", 010454378, "Sofia, Mladost", "845234087"); Loan loanAcc = new Loan(1500M, 4.5M, niki); Deposit depositAcc = new Deposit(160000, 10000, telerik); loanAcc.DepositTrans(100); Console.WriteLine(loanAcc.Balance); depositAcc.WithdrawTrans(5000); Console.WriteLine(depositAcc.Balance); Console.WriteLine(depositAcc.Interest(12)); }
public static void Main() { // Some accounts Deposite firstDeposite = new Deposite(Customers.Companies, 100000, 1.4m); Deposite secondDeposite = new Deposite(Customers.Individuals, 2500, 3.4m); Loan firstLoan = new Loan(Customers.Companies, 2400000m, 2.7m); Loan secondLoan = new Loan(Customers.Individuals, 7500, 1.001m); Mortgage firstMortgage = new Mortgage(Customers.Companies, 12400m, 5.1m); Mortgage secondMortgage = new Mortgage(Customers.Individuals, 4500, 0.11m); // Add and with draw some money firstDeposite.WithDrawMoney(1000.0m); secondDeposite.DepositeMoney(1000.0m); secondLoan.DepositeMoney(100); firstMortgage.DepositeMoney(600); // Calculate interests of amount decimal firstAmount = firstDeposite.CalculateInterestAmount(12); Console.WriteLine("Interest amount {0:F3} %", firstAmount); decimal secondAmount = firstMortgage.CalculateInterestAmount(7); Console.WriteLine("Interest amount {0:F3} %\n", secondAmount); // Create a bank Bank bank = new Bank(); // Adding some accounts in the bank bank.AddDepositeAccount(firstDeposite, secondDeposite); bank.AddLoanAccount(firstLoan, secondLoan); bank.AddMortgageAccount(firstMortgage, secondMortgage); // Print information about all account in the bank Console.WriteLine(bank.DepositeAccounts); Console.WriteLine(bank.LoanAccounts); Console.WriteLine(bank.MortgageAccounts); }
static void Main() { Account[] bankAccounts = new Account[6]; bankAccounts[0] = new Deposit("BG13IORT73778100610012", new Individual("Deljan", "Stojanov", "Zlatev", "9801062347", "0899745657", "Varna"), 0.007m); bankAccounts[0].DepositMoney(900m); ((Deposit)bankAccounts[0]).DrawMoney(100m); bankAccounts[1] = new Deposit("BG13IORT73778100610000", new Company("Dimo DZZD", "457456789", "0897234587", "Sofia"), 0.009m); bankAccounts[1].DepositMoney(2000m); bankAccounts[2] = new Loan("BG13IORT73778100610032", new Individual("Stefan", "Zlatev", "Bojanov", "9801062347", "0899745612", "Sofia"), 0.008m); bankAccounts[2].DepositMoney(1000m); bankAccounts[3] = new Loan("BG90IORT73778500650000", new Company("AAA OOD", "985456789", "0897234587", "Sofia"), 0.009m); bankAccounts[3].DepositMoney(1000m); bankAccounts[4] = new Mortgage("BG13IORT73778100610078", new Individual("Zlatina", "Givkova", "Zlateva", "9801062347", "0899745678", "Varna"), 0.005m); bankAccounts[4].DepositMoney(1000m); bankAccounts[5] = new Mortgage("BG85IORT73778600660000", new Company("BBB EOOD", "478456789", "0897234512", "Varna"), 0.009m); bankAccounts[5].DepositMoney(1000m); Console.WriteLine("Interest amount is calculated for 12 months:"); Console.WriteLine(); foreach (var item in bankAccounts) { Console.WriteLine("{0} \nInterest: {1:F2}", item, item.CalculateInterestAmount(12)); } }
public static void LoanAccountActions() { Loan acc = accounts[4] as Loan; acc.DepositMoney(1500); }