I want to split the following into a Main class and do all the math in a mortagecalc class The Arrays are tripping me up im not sure how to pass these to another class.
Thank you
package mortgageCalc;
import java.text.DecimalFormat;
public class Mainbkp {
/**
* @param args
* @throws InterruptedException
*/
public static void main(String[] args) throws InterruptedException {
double loan = 200000.00;
DecimalFormat df = new DecimalFormat("#,###.00");
//Loan Term Array
int[] loanTerm = new int[3];
loanTerm[0]=7;
loanTerm[1]=15;
loanTerm[2]=30;
//Interest Array for Loan
double [] interest = new double [3];
interest[0] = .0535;
interest[1] = .0550;
interest[2] = .0575;
for (int month = 0; month < loanTerm.length; month++)
{
double payment = (loan*(interest[month]/12))/(1-(Math.pow(1/(1+(interest[month]/12)),(loanTerm[month]*12))));
//Display Text to explain values
System.out.println("\nYour Mortgage Payment " + df.format(payment) + "\nfor the " + loanTerm[month] + " Year Contract ");
Thread.sleep(600);
}
}
}