help-octave
[Top][All Lists]

## Re: A Function to Calculate Credit Cart Limit

 From: Markus Bergholz Subject: Re: A Function to Calculate Credit Cart Limit Date: Thu, 19 Nov 2015 20:43:53 +0100

On Wed, Nov 18, 2015 at 9:59 PM, nkaplan wrote:
Hi,
I need a function to solve a problem. Let's assume we have a credit card and
we're going to pay 12.000\$ for something today. We will be paying only 20%
of our remaining debt balance per month. There will be 2.5% interest rate
per month for unpaid debt. For example, at first month, we will pay
12.000*0.2=2400\$. Then, unpaid debt (which is 9600\$) will be bringing extra
9600*0,025=240\$. So, our debt will be 9600+240=9840\$. Then, we pay 20% of it
which is 9840*0,2=1968\$, and so on.
When the remaining debt balance will be less than or equal to 10\$, we will
pay 10\$ but no 10*8=8\$.
I need a function: it will ask me amount of my payment (today), duration
(month), interest rate ( and then it calculates credit card limit that
enables me to pay 12.000\$ today.

I've written something like this but it lacks of something. I guess I need a
'for' loop for this. Also, I've written F*0.2 but it is clearly not true
because we will be paying 20% of remaining debt balance, not 20% of total
debt.

function limit
t=input('how many months you will be paying')
r=input('interest rate for remaining debt balance')
y=(F-(F*0.2))*((1+r)^t)
end
fprintf('The credit limit you need today is %d\n',y)

Are you sure you want to pay a fix percentage and not a fix amount of money?

KS * (((1+Z)^D) * Z) / (((1+Z)^D) - 1)

principal_of_loan = KS = 100
Z = interest_rate = .05
D = duration = 10

>> KS * (((1+Z)^D) * Z) / (((1+Z)^D) - 1)
ans =     12.9504574965457

it's called annual payment https://en.wikipedia.org/wiki/Annuity

--
View this message in context: http://octave.1599824.n4.nabble.com/A-Function-to-Calculate-Credit-Cart-Limit-tp4673558.html
Sent from the Octave - General mailing list archive at Nabble.com.

_______________________________________________
Help-octave mailing list