1. Member
Join Date
Mar 2017
Posts
6
Rep Power
0

## If-statement not working

deleted
Last edited by grunt9800; 03-11-2017 at 08:27 PM.

2. Senior Member
Join Date
Jan 2013
Location
Northern Virginia, United States
Posts
6,226
Rep Power
13

## Re: If-statement not working

Would an annual interest rate which is less than 1.0 every be greater than a monthly payment? Check your math
and the units you are comparing.

And once you print out that message, what do you do? You continue on executing the program.

Regards,
Jim

3. Member
Join Date
Mar 2017
Posts
6
Rep Power
0

## Re: If-statement not working

deleted
Last edited by grunt9800; 03-11-2017 at 08:27 PM.

4. Senior Member
Join Date
Jan 2013
Location
Northern Virginia, United States
Posts
6,226
Rep Power
13

## Re: If-statement not working

Well, your interest rate is a percentage so it's less than 1. But even if you don't divide by 100 does it really make sense to compare
a percentage amount to a monthly payment? So you need to figure out what to compare. You can also use an if/else construct to control

And you can use a loop to repeatedly reprompt for the numbers.

Regards,
Jim

5. Member
Join Date
Mar 2017
Posts
6
Rep Power
0

## Re: If-statement not working

deleted
Last edited by grunt9800; 03-11-2017 at 08:27 PM.

6. Senior Member
Join Date
Jan 2013
Location
Northern Virginia, United States
Posts
6,226
Rep Power
13

## Re: If-statement not working

Well, one can presume the interest rate is fixed. Now payment schedules are not as straight forward as simple interest but let's say the interest rate is 10 percent on a \$1100 loan. so that means I would pay \$100 at the beginning of each year. So I make a payment and I now owe \$1000. Next year I will owe
\$1100 (\$1000 x 1.10). So I make a new \$100 payment. Basically I am only paying the interest and not making a dent in the principal. So any payment I make must exceed the interest charged or I will never pay off the loan.

So you have to calculate an interest amount per unit time. So if the unit time is one month, then I must pay at least that much each month.

Regards,
Jim

7. Member
Join Date
Mar 2017
Posts
6
Rep Power
0

## Re: If-statement not working

deleted
Last edited by grunt9800; 03-11-2017 at 08:27 PM.

8. Member
Join Date
Mar 2017
Posts
6
Rep Power
0

## Re: If-statement not working

deleted
Last edited by grunt9800; 03-11-2017 at 08:28 PM.

9. Member
Join Date
Mar 2017
Posts
6
Rep Power
0

## Re: If-statement not working

deleted
Last edited by grunt9800; 03-11-2017 at 08:28 PM.