[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A Function to Calculate Credit Cart Limit

From: Nicholas Jankowski
Subject: Re: A Function to Calculate Credit Cart Limit
Date: Wed, 18 Nov 2015 21:12:49 -0500

On Nov 18, 2015 7:55 PM, "nkaplan" <address@hidden> 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
> F=input('Amount of your payment-today')
> 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)

Maybe I'm not understanding what you mean by credit card limit. A CC limit is the maximum amount you're allowed to carry. If you're always paying off more than the interest, you're balance will never grow and your limit never needs to be higher than the initial balance. The y you are calculating looks like it will give you your ending balance. I guess for high interest or small payments, it would grow. 

More importantly, what do you think is wrong with your function?

And I think your last printf  statement should come before the 'end'

Nick j.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]