public static void Main() { Console.WriteLine("Deposit Account: "); var depositAcc = new DepositAccount(new Individual("Katya Ivanova", 213, new DateTime(1996, 5, 21), Gender.Female), 200000, 4); Console.WriteLine(depositAcc.ToString()); depositAcc.AddMoney(20000); depositAcc.WithdrawMoney(213); Console.WriteLine("{0} Interest amount: {1}%", depositAcc.GetType().Name, depositAcc.InterestAmount(8)); // interest amount method Console.WriteLine(new string('-', 50)); var companyDeposit = new DepositAccount(new Company("Apple", 12345, "Steve Jobs"), 52342343, 234); Console.WriteLine(companyDeposit.ToString()); Console.WriteLine(new string('-', 50)); Console.WriteLine("Loan Deposit: "); var loanDeposit = new LoanAccount(new Individual("Dimitur Topchev", 213, new DateTime(1992, 12, 14), Gender.Male), 2000, 2); Console.WriteLine(loanDeposit.ToString()); Console.WriteLine("Interest amount {0}%", loanDeposit.InterestAmount(12)); loanDeposit.AddMoney(23456); Console.WriteLine(new string('-', 50)); Console.WriteLine("Mortgage Deposit"); var mortgageAcc = new MortgageAccount(new Company("BFFS", 12383128, "Golemata Hazna"), 2500000, 0.1m); Console.WriteLine(mortgageAcc.ToString()); Console.WriteLine("Interest amount {0}%", mortgageAcc.InterestAmount(12)); }
public static void TestDepositingAndWithdrawing() { // the test includes only deposit account whtihdrawing and depositing // because the output on the console would be too long // feel free to test the other components :) // creating an instance of an individual type customer var peshoCustomer = new IndividualCustomer("Pesho"); // creating a deposit account and printing the information about the account var peshoDeposit = new DepositAccount(peshoCustomer, 25000, 2.5); Console.WriteLine(peshoDeposit); Console.WriteLine("============================"); // depositing some money in the same account and printing it's information again peshoDeposit.DepositMoney(34.50m); Console.WriteLine(peshoDeposit); Console.WriteLine("============================="); // widthdrawing some money and then printing it's information again peshoDeposit.WithdrawMoney(120.68m); Console.WriteLine(peshoDeposit); Console.WriteLine("=============================="); }
public static void Main() { var depositAcount = new DepositAccount(Customers.individual, 11500, 3); Console.WriteLine(depositAcount.Balance); depositAcount.DepositMoney(6000); Console.WriteLine(depositAcount.Balance); depositAcount.WithdrawMoney(4000); Console.WriteLine(depositAcount.Balance); }
static void Main() { // Deposit Account Tests Console.WriteLine("Deposit Account Test:"); Console.WriteLine(); var individualDeposit = new DepositAccount(new Individual("Joro Ivanov", 666, new DateTime(1995, 3, 8), GenderType.Male), 100000, 3); Console.WriteLine("Before depositing and withdrawing money"); Console.WriteLine(individualDeposit); individualDeposit.DepositMoney(15600); individualDeposit.WithdrawMoney(854); Console.WriteLine("After depositing and withdrawing money"); Console.WriteLine(individualDeposit); Console.WriteLine("{0} Interest amount: {1}%", individualDeposit.GetType().Name, individualDeposit.InterestAmount(8)); Console.WriteLine(new string('-', 50)); var companyDeposit = new DepositAccount(new Company("Batman Inc", 1, "Bruce Wayne"), 200006, 111); Console.WriteLine(companyDeposit); Console.WriteLine(new string('-', 50)); // Loan Account Tests Console.WriteLine("Loan Account Test:"); Console.WriteLine(); var loanAccount = new LoanAccount(new Individual("Penka Draganova", 5, new DateTime(1990, 11, 21), GenderType.Female), 1000, 2); Console.WriteLine(loanAccount); Console.WriteLine("Interest amount {0}%", loanAccount.InterestAmount(12)); loanAccount.DepositMoney(2000); // Paying the loan Console.WriteLine(new string('-', 50)); // Mortgage Account Tests Console.WriteLine("Mortgage Account Test:"); Console.WriteLine(); var mortgageAcc = new MortgageAccount(new Company("Ivo's Company", 19500, "Ivo"), 280000, 5.5m); Console.WriteLine(mortgageAcc); Console.WriteLine("Interest amount {0}%", mortgageAcc.InterestAmount(12)); }
public static void Main() { // Some tests Console.WriteLine("Deposit Account: "); var depositAcc = new DepositAccount(new Individual("Tanya Skovska", 213, new DateTime(1994, 5, 26), Gender.Female), 200000, 4); Console.WriteLine(depositAcc.ToString()); depositAcc.AddMoney(20000); depositAcc.WithdrawMoney(213); Console.WriteLine("{0} Interest amount: {1}%", depositAcc.GetType().Name, depositAcc.InterestAmount(8)); // interest amount method Console.WriteLine(new string('-', 50)); var companyDeposit = new DepositAccount(new Company("Microsoft INC", 12345, "Bil Geits"), 44352423432, 234); Console.WriteLine(companyDeposit.ToString()); Console.WriteLine(new string('-', 50)); Console.WriteLine("Loan Deposit: "); var loanDeposit = new LoanAccount(new Individual("Pesho Peshov", 213, new DateTime(1990, 12, 16), Gender.Male), 2000, 2); Console.WriteLine(loanDeposit.ToString()); Console.WriteLine("Interest amount {0}%", loanDeposit.InterestAmount(12)); loanDeposit.AddMoney(23456); Console.WriteLine(new string('-', 50)); Console.WriteLine("Mortgage Deposit"); var mortgageAcc = new MortgageAccount(new Company("BFS", 12383128, "Golqmata Peruka"), 2500000, 0.1m); Console.WriteLine(mortgageAcc.ToString()); Console.WriteLine("Interest amount {0}%", mortgageAcc.InterestAmount(12)); }