It compiles, but it does not run correctly :mad:

import java.io.*;

public class Bert

{

public static void main(String[] args) throws IOException

{

//Declaring Variables

String custName, inputPrice, inputDownPayment, inputTradeIn, inputMonths, inputAnnualInterest;

int price, downPayment, tradeIn, months, annualInterest;

double loanAmt,interest, payment;

BufferedReader dataIn = new BufferedReader(new InputStreamReader(System.in));

//Get Input from User

System.out.print("What is your name? ");

custName = dataIn.readLine();

System.out.print("What is the price of the car? ");

inputPrice = dataIn.readLine();

price = Integer.parseInt(inputPrice);

System.out.print("What is the downpayment? ");

inputDownPayment = dataIn.readLine();

downPayment = Integer.parseInt(inputDownPayment);

System.out.print("What is the trade-in value? ");

inputTradeIn = dataIn.readLine();

tradeIn = Integer.parseInt(inputTradeIn);

System.out.print("For how many months is the loan? ");

inputMonths = dataIn.readLine();

months = Integer.parseInt(inputMonths);

System.out.print("What is the decimal interest rate? ");

inputAnnualInterest = dataIn.readLine();

annualInterest = Integer.parseInt(inputAnnualInterest);

//Calculations

interest = annualInterest / 12;

loanAmt = price-downPayment-tradeIn;

payment= loanAmt / ((1/interest)-(1/(interest * Math.pow(1+interest, months))));

//Output

System.out.println("The monthly payment for " + custName + " is $");

System.out.print(payment);

}

}