Results 1 to 5 of 5
 09012014, 04:06 AM #1Member
 Join Date
 Sep 2014
 Posts
 1
 Rep Power
 0
Importing Math fomula to java HELP!!
i am trying to calculate the number of months it takes to pay off a set amount of credit card debt given the following information: principle amount, annual
interest rate, and monthly payment. does anyone know how to import the formula necessary to system.out.print the answer (number of months it takes to
pay off debt) ??? thanks!!
 09012014, 04:29 AM #2
Re: Importing Math fomula to java HELP!!
how to import the formula
Maybe copy and paste would work if you find another source to copy it from.If you don't understand my response, don't ignore it, ask a question.
 09012014, 08:00 AM #3
 Join Date
 Sep 2008
 Location
 Voorschoten, the Netherlands
 Posts
 14,422
 Blog Entries
 7
 Rep Power
 28
Re: Importing Math fomula to java HELP!!
As Norm already wrote: you can't import a mathematical formula in Java; you have to translate it to Java; this can be easy or difficult; it depends on the formula and the notation used.
kind regards,
JosBuild a wall around Donald Trump; I'll pay for it.
 09022014, 10:30 AM #4Member
 Join Date
 Aug 2011
 Location
 Cornwall, UK
 Posts
 25
 Rep Power
 0
Re: Importing Math fomula to java HELP!!
If you have a loan of £1000, an interest rate of 10% and a repayment of £25, you will need to use a loop together with some conditional states and an incremented month count to arrive at the answer.
At the start of the loan (month 0) the balance will be the principal times the interest (£1050)
Between months 1 and 11 the loan will decrease by the monthly repayment.
On this and every other subsequent time that the month count leaves a 0 remainder when divided by 12 the interest is applied for the next 12 months.
You will require variables for the principal, the interest, the repayment, the balance and the number of months suitably initialised.
I would use a 'While ? >= 0' loop with an embedded 'If ? = 0' conditional statement. After the while loop you will need code for the final cleanup 'If ? > 0' to cater for any final repayment.
HTH
P.S. It would take 51 months with a final repayment of less than £16
 09022014, 11:06 AM #5Just a guy
 Join Date
 Jun 2013
 Location
 Netherlands
 Posts
 5,114
 Rep Power
 13
Similar Threads

Importing a .java class
By natdizzle in forum EclipseReplies: 3Last Post: 01152012, 12:05 AM 
Importing Java API's into Eclipse
By ryan.jones in forum New To JavaReplies: 2Last Post: 03232011, 10:46 AM 
Problem with importing IO from java
By Anandt88 in forum Java ServletReplies: 2Last Post: 06222010, 12:00 PM 
Importing a .java
By Kaito in forum New To JavaReplies: 5Last Post: 09242009, 01:33 AM 
Importing Picture into Java Code
By swimmy101 in forum New To JavaReplies: 1Last Post: 02122009, 08:48 AM
Bookmarks