示例#1
0
        //Methods
        public double BalanceNextYearRenting(RentalProperty rentalProperty, double deposits)
        {
            double balanceNextYear;
            double savingsInterest;

            //Costs
            double costs = rentalProperty.AnnualRent;

            savingsInterest = currentSavings * savingsInterestRate;
            balanceNextYear = (currentSavings + savingsInterest + deposits) - costs;

            return(balanceNextYear);
        }
示例#2
0
        public double[] BalanceRenting(RentalProperty rentalProperty, double deposits, int term)
        {
            double[] savings = new double[term + 1];
            double   savingsInterest;

            //Costs
            double costs = rentalProperty.AnnualRent;

            savings[0] = currentSavings;

            for (int i = 1; i < term + 1; i++)
            {
                savingsInterest = savings[i - 1] * savingsInterestRate;
                savings[i]      = (savings[i - 1] + savingsInterest + deposits) - costs;

                System.Diagnostics.Debug.WriteLine("Savings for year " + i + ": " + savings[i]);
            }
            return(savings);
        }