Results 1 to 6 of 6
  1. #1
    EpyonCustom is offline Member
    Join Date
    Mar 2011
    Posts
    23
    Rep Power
    0

    Default Mortgage Monthly Payment Formula

    Greetings Java Forums,

    I have to create a method that calculates the mortgage monthly payment, using the following formula:

    Loan Payment Formula

    But I don't know how I'm supposed to write this in Java, specifically the power part.

    How would I go about writing this formula in Java? Thanks again.

  2. #2
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    12

    Default

    I didn't follow the link(I don't follow links) but you can use Math.pow, would you mind copy and pasting the formula?

  3. #3
    EpyonCustom is offline Member
    Join Date
    Mar 2011
    Posts
    23
    Rep Power
    0

    Default

    Here is the formula:


  4. #4
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    12

    Default

    What have you tried so far?

  5. #5
    dlorde is offline Senior Member
    Join Date
    Jun 2008
    Posts
    339
    Rep Power
    10

    Default

    It's probably easiest to break it down into stages so you can check each stage is giving the right result, e.g. (pseudocode)
    a = 1 + rate
    b = Math.pow(a, months)
    c = b - 1
    d = rate / c
    e = rate + d
    f = e * principal

    If that's too simple, you can combine steps together, as you see fit.

  6. #6
    EpyonCustom is offline Member
    Join Date
    Mar 2011
    Posts
    23
    Rep Power
    0

    Default

    Quote Originally Posted by sunde887 View Post
    What have you tried so far?
    I basically typed out the formula without the power:

    double monthlyInterestPayment=(0.0032 + (0.0032 / ((1 + 0.0032) - 1)) + 1800);

    Quote Originally Posted by dlorde View Post
    It's probably easiest to break it down into stages so you can check each stage is giving the right result, e.g. (pseudocode)
    a = 1 + rate
    b = Math.pow(a, months)
    c = b - 1
    d = rate / c
    e = rate + d
    f = e * principal

    If that's too simple, you can combine steps together, as you see fit.
    Thanks. I think I'll do something like that. I'll let you guys know if it works.

    EDIT: Yep, it works. +rep to both of you guys.

    Now I just have to figure out how to do the rest of this assignment!
    Last edited by EpyonCustom; 04-28-2011 at 02:20 AM.

Similar Threads

  1. monthly mortgage payment formula
    By leoshiner in forum New To Java
    Replies: 2
    Last Post: 04-22-2011, 02:46 PM
  2. monthly temperatures
    By droidus in forum New To Java
    Replies: 23
    Last Post: 04-05-2011, 03:21 AM
  3. Mortgage Calculator
    By rsmithjr316 in forum New To Java
    Replies: 14
    Last Post: 01-21-2011, 11:53 PM
  4. Mortgage Calculator
    By pablo2002 in forum Java Applets
    Replies: 3
    Last Post: 09-25-2010, 11:34 PM
  5. mortgage calculator help
    By kalibballer in forum New To Java
    Replies: 1
    Last Post: 03-26-2009, 12:35 PM

Posting Permissions

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