static void Main()
        {
            Deposit deposit = new Deposit(400m, 0.01m, Customer.Individual);

            Console.WriteLine("Deposit Account: ");
            Console.WriteLine("Interest rate: " + deposit.CalculateRate(20));

            deposit.DepositMoney(100000);
            Console.WriteLine("Balance after depositing: " + deposit.Balance);
            Console.WriteLine("Interest rate: " + deposit.CalculateRate(20));

            deposit.WithdrawMoney(100400);
            Console.WriteLine("Balance after withdrawing: " + deposit.Balance);
            Console.WriteLine();

            Mortgage mortgage = new Mortgage(500000, 0.02m, Customer.Company);

            Console.WriteLine("Mortgage Account: ");
            Console.WriteLine("Interest rate for company: " + mortgage.CalculateRate(12));
            mortgage.Customer = Customer.Individual;
            Console.WriteLine("Interest rate for individual: " + mortgage.CalculateRate(7));
            Console.WriteLine();

            Loan loan = new Loan(500000, 0.02m, Customer.Company);

            Console.WriteLine("Loan Account: ");
            Console.WriteLine("Interest rate for company: " + loan.CalculateRate(24));
            loan.Customer = Customer.Individual;
            Console.WriteLine("Interest rate for individual: " + loan.CalculateRate(3));
        }
 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));
 }
Beispiel #3
0
        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));
        }