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() { Customer pesho = new IndividualCustomer("Petar Petrov", "8301125555"); Customer softUni = new CompanyCustomer("SoftUni", "BG 93871904730914"); Account peshoDeposit = new DepositAcount(pesho, 0.7m, 10000); Console.WriteLine("The deposit of pesho is " + peshoDeposit.CalculateInterest(12).ToString("f2")); Console.WriteLine(); Account peshoLoan = new LoanAccount(pesho, 0.9m, 1000); Console.WriteLine("The loan of pesho is " + peshoLoan.CalculateInterest(4).ToString("f2")); Account softuniLoan = new LoanAccount(softUni, 12m, 5000); Console.WriteLine("The loan of softuni is: " + softuniLoan.CalculateInterest(4).ToString("f2")); Console.WriteLine(); Account peshoMortgage = new LoanAccount(pesho, 2m, 5000); Console.WriteLine("The mortgage of pesho is: " + peshoMortgage.CalculateInterest(6).ToString("f2")); Account softuniMortgage = new LoanAccount(softUni, 5m, 1000); Console.WriteLine("The mortgage of softuni is: " + softuniMortgage.CalculateInterest(6).ToString("f2")); Console.WriteLine(); }
static void Main(string[] args) { Customer petar = new IndividualCustomer("Petar Gigov", "8412316466"); Customer softUni = new CompanyCustomer("Software University", "BG25445644"); Account petarDepositAccount = new DepositAccount(petar, 1000m, 3.0m); Console.WriteLine(petarDepositAccount.CalculateInterest(12).ToString("f2")); Console.WriteLine(); Account petarLoanAccount = new LoanAccount(petar, 10000m, 12m); Console.WriteLine(petarLoanAccount.CalculateInterest(4).ToString("f2")); Account softuniLoanAccount = new LoanAccount(softUni, 10000m, 12m); Console.WriteLine(softuniLoanAccount.CalculateInterest(4).ToString("f2")); Console.WriteLine(); Account petarMortgageAccount = new MortgageAccount(petar, 10000m, 12m); Console.WriteLine(petarMortgageAccount.CalculateInterest(12).ToString("f2")); Account softUniMortgageAccount = new MortgageAccount(softUni, 10000m, 12m); Console.WriteLine(softUniMortgageAccount.CalculateInterest(12).ToString("f2")); Console.WriteLine(); }
static void Main() { Customer firstCustomer = new Individual("111", "1111111111", "Pesho", "Petrov"); LoanAccount loanAccount = new LoanAccount(firstCustomer, 500m); Console.WriteLine(loanAccount.CalculateInterest(50, 12)); }
static void Main(string[] args) { Customer pesho = new IndividualPerson("Pesho Peshev"); Customer globalEntertainmentOOD = new Company("Global Entertainment LTD"); IAccountable depositAcc = new DepositAccount(pesho, 2000m, 1.7d); IAccountable loanAcc = new LoanAccount(pesho, 5000, 5.5d); IAccountable mortageAcc = new MortageAccount(globalEntertainmentOOD, 100000, 2.3d); IList <IAccountable> accounts = new List <IAccountable>() { depositAcc, loanAcc, mortageAcc }; depositAcc.CalculateInterest(8d); depositAcc.DepositMoney(200m); depositAcc.WithdrawMoney(50m); loanAcc.CalculateInterest(20d); }
static void Main() { Customer petar = new IndividualCustomer("Petar Gigov", "8412316466"); Customer softUni = new CompanyCustomer("Software University", "BG25445644"); Account petarDepositAccount = new DepositAccount(10000, 3.0m, petar); Console.WriteLine(petarDepositAccount.CalculateInterest(12).ToString("f2")); Console.WriteLine(); Account petarLoanAccount = new LoanAccount(10000, 12m, petar); Console.WriteLine(petarLoanAccount.CalculateInterest(4).ToString("f2")); Account softuniLoanAccount = new LoanAccount(10000, 12m, softUni); Console.WriteLine(softuniLoanAccount.CalculateInterest(4).ToString("f2")); Console.WriteLine(); Account petarMortgageAccount = new MortgageAccount(10000, 12m, petar); Console.WriteLine(petarMortgageAccount.CalculateInterest(12).ToString("f2")); Account softUniMortgageAccount = new MortgageAccount(10000, 12m, softUni); Console.WriteLine(softUniMortgageAccount.CalculateInterest(12).ToString("f2")); Console.WriteLine(); }