as you can see, I broke the formula down, testing values at each step with print commands. the values did display. However, getting to line #71 states that "the assigned value is never used". I'm simultaneously running a previous version that does correctly calculate and output...but the code is identical. So...can anyone see something I'm overlooking?
Thanks in Advance
-DoubleM
inputRate = loanScanner.nextDouble ( ); //Accepts entered APR.
if (inputRate != (termRate[i]) ){ //Validates input. Begin If statement.
out.println("Sorry, you entered an invalid option for the APR . Please try again.");
// if (inputRate == termRate[i]){
// if (inputYears == termYear[i] && inputRate == termRate [i]){
} else { // Close If, Begin Else
monthlyInterestRate = termRate[i]/ 100 / 12; //termRate==annualInterestRate
out.println("monthly interest rate is " + monthlyInterestRate); //display tests values.
//Divide interestRate by 100 to return decimal value. termRate[i]/ 100 / 12=
//Divide the results by 12 to return the monthly intest rate.
termMonths = termYear[i] * 12; //obtains months from 7,15 & 30 yr.terms.
//Find the numerator of the formula.Multiply the monthlyInterestRate by principleAmount.
out.println("term months equals" + termMonths); //tests output of termMonths value. It works.
formulaNumerator = (monthlyInterestRate * principleAmount);
//Solve for Denominator by using Javas' .pow function.
out.println (" the numerator is " + formulaNumerator); //tests vaue. it works.
formulaDenominator = 1 - (java.lang.Math.pow((1 + monthlyInterestRate), (-1 * termMonths)));
out.println("the denominator is" + formulaDenominator); //tests value. works.
monthlyPayment = formulaNumerator / formulaDenominator;
// Display formatted payment amount
out.println("Your mortgage principle of " + sprincipleAmount
+ " for " + termYear[i] +" years at " + termRate[i] + "% APR comes to "
+ smonthlyPayment + " monthly. \n");
for (int k=0; k < 3; k++){ //Begin For Loop
}

New Topic/Question
Reply




MultiQuote






|