|
|
Car Loan Calculator
|
can anyone help out in writing a simple car loan calculator in JAVA?
The car loan calculator should exhibit proper use of exception handling,methods, iteration and selection statements and arrays.... it should require CAR PRICE, DOWN PAYMENT,MONTH LOAN and LOAN INTEREST
Get the answers
|
|
I need help in figuring out where my java program has wrong calculations...?
It is a car loan calculator and it isn't giving me the correct figures for a payment when the amount, downpayment, months, and interest is figured.
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
double carPrice = Double.parseDouble(caramttext.getText());
double downPayment = Double.parseDouble(downpaymenttxt.getText());
int lengthLoan = Integer.parseInt(Months.getSelectedItem().toString());
double interestRate = 0.00;
if (interest5.isSelected()) {
interestRate = 5.00;
} else if (interest10.isSelected()) {
interestRate = 10.00;
} else if (interest12.isSelected()) {
interestRate = 12.00;
}
// The following sets the text that is entered as the value for the variable:
double princ = carPrice - downPayment;
double rate = interestRate / 100.00 / 12.00;
int month = (lengthLoan * 12);
double num = princ * rate;
double den = (1 - Math.pow(1 + rate, -month));
double monthlyPayment = den != 0 ? num / den : 0;
// The following will create a new format object for currency:
DecimalFormat money = new DecimalFormat("$ #,##0.00");
// The following calculates the payments depending on the interest rate selected:
// The following will display the results
Paymenttxt.setText(String.valueOf(money.format(monthlyPayment)));
}
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
caramttext.setText(null);
downpaymenttxt.setText(null);
Paymenttxt.setText(null);
}
Get the answers
|
|
I need a car loan calculator?
i need one where i can enter my original loan amount, the number of months i have paid, the payment amount, and the interest rate
i need to know what my remaining balance is
Get the answers
|
Next page: Car Loan Company
Bookmark/Share This Page:
Car Loan Calculator News
|
|