QUOTE(capty99 @ 4 Feb, 2008 - 04:12 PM)

follow what the errors say and you see the issues :
CODE
interest = .0550/12;
months = 12*15;
loan2 =(amount*interest)/(1-Math.pow(1 + interest, -months));
you have an array of 3 items called interest, so what are you trying to do with this .0550/12. add it to the array? then add, don't just set it equal to.
same for months
[reply]
Okay, I see. What I can't seem to understand is how I would equate say the 5.35% interest rate to loan1. In addition, the 84 months to loan1. Thanks for your help!
[/reply]
/* Purpose:Write the program in Java (without a graphical user interface) and have it calculate the payment
amount for 3 mortgage loans:*/
CODE
import java.io.*;
import java.util.*;
import java.text.*;
public class MortgageCalculator4
{
public static void main(String[] args)
{
NumberFormat nf = NumberFormat.getCurrencyInstance();
//declaring and contruct variables and arrays
int amount= 200000;
double[] interest={5.35, 5.50, 5.75};
int[] months={7,15,30};
int loan1;
int loan2;
int loan3;
loan1 =(amount*interest)/(1-Math.pow(1 + interest, -months));
//print out variables
System.out.println("\t\tAmount to be financed is: " + amount);
System.out.println("\t\tInterest Rate: " + interest);
System.out.println("\t\tThe Term of Loan (in months): " + months);
System.out.println("\t\tThe Monthly Payment is: " + nf.format(loan1));
loan2 =(amount*interest)/(1-Math.pow(1 + interest, -months));
//print out variables
System.out.println("\t\tAmount to be financed is: " + amount);
System.out.println("\t\tInterest Rate: " + interest);
System.out.println("\t\tThe Term of Loan (in months): " + months);
System.out.println("\t\tThe Monthly Payment is: " + nf.format(loan2));
loan3 =(amount*interest)/(1-Math.pow(1 + interest, -months));
//print out variables
System.out.println("\t\tAmount to be financed is: " + amount);
System.out.println("\t\tInterest Rate: " + interest);
System.out.println("\t\tThe Term of Loan (in months): " + months);
System.out.println("\t\tThe Monthly Payment is: " + nf.format(loan3));
}
}