hi, i was trying to write a program with multiple arrays but i cannot figure it out. i was hoping someone could help me out. i would like to calculate these into it 7 year at 5.35%, 15 year at 5.5 %,
//and 30 year at 5.75%. here is my code
public class Calculator {
public static void main(String[] args)
{
System.out.println("Ramon's Mortgage Calculator!");
System.out.println (" ");
double loan, years, totalinterestpaid, monthlypayment;
loan = 200000; //loan amount
years = 30; //years of loan
totalinterestpaid = 220174;
monthlypayment = ((totalinterestpaid + loan)/ 360);
System.out.print("Your total monthly mortgage payment is ");
System.out.println(monthlypayment);
System.out.println (" ");
double loanbalance, interest, monthlyinterest;
int months;
months = 0
;while (months < 16){
interest = loan * .00479166;
loanbalance = loan;
loan = loan - monthlypayment + interest;
monthlyinterest = loan * .00479166;
months = months + 1;
System.out.print ("Loan Balance for month ");
System.out.print (months);
System.out.print (" is $");
System.out.println (loanbalance);
System.out.print ("Intrest paid for month ");
System.out.print (months);
System.out.print (" is $");
System.out.println (monthlyinterest);
System.out.println (" ");
}
;while (months < 16){
interest = loan * .00479166;
loanbalance = loan;
loan = loan - monthlypayment + interest;
monthlyinterest = loan * .00479166;
months = months + 1;
System.out.print ("Loan Balance for month ");
System.out.print (months);
System.out.print (" is $");
System.out.println (loanbalance);
System.out.print ("Intrest paid for month ");
System.out.print (months);
System.out.print (" is $");
System.out.println (monthlyinterest);
System.out.println (" ");
}
}
}
array
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard