Results 1 to 5 of 5
  1. #1
    esallender is offline Member
    Join Date
    Oct 2010
    Posts
    9
    Rep Power
    0

    Default payment calculator

    :cool:now i am having trouble figuring out the payment part.

    public void pricechanger() {
    pCal.setprice(Integer.parseInt(jTextField4.getText ()));
    jTextField5.setText(payment.CalculatePayment());
    }

    keeps telling me there is an issue with the payment.CalculatePayment()

    what am i doing wrong. its probably a silly mistake.

  2. #2
    user0 is offline Senior Member
    Join Date
    Dec 2010
    Posts
    100
    Rep Power
    0

    Default

    Hi - it would help if you posted what the error message is :) And also, can you show what the CalculatePayment() method looks like.

    Best,
    --user0--

  3. #3
    esallender is offline Member
    Join Date
    Oct 2010
    Posts
    9
    Rep Power
    0

    Default error

    it says it cannot find symbol for variable payment.
    It should be:: payment.calculatePayment()

    heres the code for calulatePayment

    public String calculatePayment() {
    double principal = priceOfCar - downPayment;
    double interest = interestRate / 1200;
    double x = Math.pow(1 + interestRate, yearsOfLoan * 12 - 1);
    double payment = (interest + interest / x * principal);
    //instantiates number format
    NumberFormat nf = NumberFormat.getCurrencyInstance();
    //returns a String as a currency representaion
    return nf.format(payment);
    }

  4. #4
    user0 is offline Senior Member
    Join Date
    Dec 2010
    Posts
    100
    Rep Power
    0

    Default

    What is the name of your main class? Did you create a payment object?
    --user0--

  5. #5
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    The method is: calculatePayment

    You are calling: CalculatePayment

    Do you see the difference?

    And by the way, when posting error messages, please post the actual stack trace, not your interpretation of it. This way it's much easier to help you.

Similar Threads

  1. session suddenly gone after do online payment
    By ibudiman in forum Advanced Java
    Replies: 1
    Last Post: 12-03-2010, 09:36 PM
  2. Payment Calculator help
    By rpetronejr in forum New To Java
    Replies: 3
    Last Post: 07-04-2010, 01:37 AM
  3. need help with my calculator
    By semoche in forum AWT / Swing
    Replies: 6
    Last Post: 12-04-2009, 10:16 PM
  4. Calculator
    By water in forum AWT / Swing
    Replies: 4
    Last Post: 09-23-2009, 06:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •