JavaNovice484
Programmer
Greetings,
I can't seem to compile my very small program....will someone please take a look to see where I've gone wrong, again I'm no programmer, simply a novice that's taken an intrest in different programming lanuages.
/*
Purpose: Calculates Monthly Car Payments
*/
import java.io.*;
public class Bert
{
public static void main(String[] args)
{
//Declaring Variables
int price, DownPayment, TradeIn, Months,loanAmt, interest;
int annualInterest, payment;
String custName, inputPrice,inputDownPayment,inputTradeIn,inputMonths, inputAnnualInterest;
BufferedReader dataIn = new BufferedReader(new InputStreamReader(System.in));
//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 = Integer.parseInt(inputAnnualInterest);
//Calculations
interest = annualInterest/12;
loanAmt = price-DownPayment-TradeIn;
payment=loanAmt/((1/interest)-(1/(interest*Math.round(1+int Months))))));
//Output
System.out.print("The monthly payment for " + custName + " is $");
System.out.println(payment);
}
}
I can't seem to compile my very small program....will someone please take a look to see where I've gone wrong, again I'm no programmer, simply a novice that's taken an intrest in different programming lanuages.
/*
Purpose: Calculates Monthly Car Payments
*/
import java.io.*;
public class Bert
{
public static void main(String[] args)
{
//Declaring Variables
int price, DownPayment, TradeIn, Months,loanAmt, interest;
int annualInterest, payment;
String custName, inputPrice,inputDownPayment,inputTradeIn,inputMonths, inputAnnualInterest;
BufferedReader dataIn = new BufferedReader(new InputStreamReader(System.in));
//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 = Integer.parseInt(inputAnnualInterest);
//Calculations
interest = annualInterest/12;
loanAmt = price-DownPayment-TradeIn;
payment=loanAmt/((1/interest)-(1/(interest*Math.round(1+int Months))))));
//Output
System.out.print("The monthly payment for " + custName + " is $");
System.out.println(payment);
}
}