Need help with java program to compute monthly payment of a car loan with user input?

Answers:0   |   LastUpdateAt:2012-11-02 01:11:19  

Question
HELP URGANT!
Asked at
I am in java 101 so its beginner code so don't get too complex.
Here is the code i have so far. It works but gets the wrong answer.

import javax.swing.*;
import java.text.*;

public class Project2 {


public static void main(String[] args) {

double carPrice, downPayment, annualInterestRate, monthlyPayment;
int numberOfPayments;

System.out.println("This program computes monthly payment for a car loan given price of a car, down payment, interest rate and number of payments.");

String userCarPrice = JOptionPane.showInputDialog(null, "Please enter the Price of the car");
carPrice = Double.parseDouble(userCarPrice);

String userDownPayment = JOptionPane.showInputDialog(null, "Please enter the down payment");
downPayment = Double.parseDouble(userDownPayment);

String userAnnualInterestRate = JOptionPane.showInputDialog(null, "Please enter the annual interest rate");
annualInterestRate = Double.parseDouble(userAnnualInterestRat
Answers

This Question:"Need help with java program to compute monthly payment of a car loan with user input?" No answers yet. Be the first!
Related Questions
1
  • Answer This Question:Need help with java program to compute monthly payment of a car loan with user input?