Can you write a simple code in Mathematica software to calculate in how many years you will repay a debt at 6%.
A=2000, I=6%, M.P. = 200
Java Program:
public class NumOfMonths {
public static void main(String args[])
{
double A=2000;
double I=6;
double MP=200;
double i= I/12/100;
//N = −log(1−iA/P) / log(1+i)
double t1=-Math.log(1-i*A/MP);
double t2=Math.log(1+i);
double years =t1/t2;
System.out.println(" You can take out $"+MP+" a month for
"+Math.ceil(years)+" months");
}
}
Output:
Get Answers For Free
Most questions answered within 1 hours.