Title: Calculator
1Calculator
Calculator simple interest
i interest rate on the loan term length of
time to repay the loan principle amount borrowed
2Calculator
Calculating the payment is a two-step process
1. Convert input to term of the loan 2.
Calculate the payment
Input Amount of Loan Principle Term of the
Loan Years Interest Rate Yearly rate,
expressed as a percentage
Example Loan 15,000 Term 5 years Interest
4.9
We want to retain the input for use in display
therefore, we need to have separate variables for
the converted data
3Calculator
Calculating the payment i interest rate,
converted to the payment schedule (interest/month
- im) term number of payments (number of months)
4Calculator
Term Entered as years needs to be converted to
months
- Interest
- Entered as a whole number needs double
conversion - First convert to the decimal equivalent
- Second convert to the monthly equivalent
months term of loan in months id Interest
rate in decimal value im Interest rate in
monthly decimal value
5Calculator
Calculate the payment in steps (like in the
quadratic problem)
Calculate the numerator
Calculate the embedded term
Calculate the denominator
Calculate the payment
6Calculator
- To calculate the monthly payment is a twostep
process - Convert the input to values appropriate for the
payment cycle - Use the converted values to calculate the monthly
payment
Now that we have a monthly payment, we can
calculate the remaining information on the
loan Total Payment the amount actually paid
out of your pocket. Total Interest paid over the
life of the loan
7Calculator
Total Payment the amount actually paid out of
your pocket. Total payment is the monthly payment
multiplied by the number of payments made over
the life of the loan TotalPay payment
months Total Interest paid over the life of the
loan Interest paid is the difference between what
you originally borrowed what you pay
back TotalInt TotalPay - principle
8Calculator
To calculate a loan payment, the program should
be written with each module completing a given
task.
One module should do the necessary
conversions Loan length to number of payments
(usually that is years to months) Interest rate
from a percentage value to the equivalent decimal
value, then to the interest rate per payment term
(quarter, months, weeks)
9Calculator
To calculate a loan payment, the program should
be written with each module completing a given
task.
One module should do the necessary calculations
Once the payment is calculated, total amount paid
and total interest paid can be calculated. These
can be part of the payment calculation module.