Debugging Assignment, Chapter 3, Bert,java
Java Programming Third Edition Complete Concepts and Tecniques
I have a problem in this calculation: payment=loanAmt/((1/interest)-(1/(interest*Math.round(1+ inputMonths))));
/*
Chapter 3Debugging Assignment
Programmer:
Date:
Program Name:Bert,java
Purpose:
*/
import java.io.*;
public class Bert
{
public static void main(String[] args) throws IOException
{
BufferedReader dataIn = new BufferedReader (new InputStreamReader(System.in));
//Declaring Variables
int price, downpayment, tradeIn, months,loanAmt, interest;
double annualInterest, payment;
String custName, inputPrice,inputDownPayment,inputTradeIn,inputMonths, inputAnnualInterest;
//Get Input from User
System.out.println("What is your name?");
custName = dataIn.readLine();
System.out.print("What is the price of the car?");
inputPrice = dataIn.readLine();
System.out.print("What is the downpayment?");
inputDownPayment = dataIn.readLine();
System.out.print("What is the trade-in value?");
inputTradeIn = dataIn.readLine();
System.out.print("For how many months is the loan?");
inputMonths = dataIn.readLine();
System.out.print("What is the decimal interest rate?");
inputAnnualInterest = dataIn.readLine();
//Conversions
price = Integer.parseInt(inputPrice);
downpayment = Integer.parseInt(inputDownPayment);
tradeIn = Integer.parseInt(inputTradeIn);
months = Integer.parseInt(inputMonths);
annualInterest =Double.parseDouble(inputAnnualInterest);
//Calculations
payment=loanAmt/((1/interest)-(1/(interest*Math.round(1+ inputMonths))));
//Output
System.out.print("The monthly payment for " + custName + " is $");
System.out.println((int)payment);
;
}
}
Can some one helpme?
plizzzz I'm desperate

