hey guys, i have to do this program and i'm having trouble:

Write a program that lets the user enter the loan amount and loan period in number of years and displays the monthly and total payments for each interest rate starting from 5% to 8%, with an increment of 1/8.

Example: If you enter the loan amount 10,000 for 5 years; display a table as follows:

Loan Amount: 10000
Number of Years: 5

Interest Rate                     Monthly Payment               Total Payment
5%                                       188.71                                 11322.74
5.125%                                189.28                                 11357.13
5.25%                                  189.85                                 11391.59
...

7.85%                                  202.16                                  12129.97
8.0%                                    202.76                                  12165.83
_____________________________________________________

this is all i have, can someone please help me, because i'm really getting myself confused. if anyone could help me at all, it will be greatly appreciated

class Loans
{
    public static void main(String[] args);
    {
int rate;
double monthlyPayment;
double loanAmount;
double total;
double numberOfYears;

these are the headings i came up with but i dont know how to do them:
// convert rate to monthlyrate
// calculate monthly payment
// display monthly payment - printf

// calculate yearly payment
// display - printf % 5.2f

Recommended Answers

All 3 Replies

Have you been given a formula for the above calculations because they are not java related and not all people know them, But they can write the code once they are provided.

i dont have formulas for the stuff above.

i dont need to use those exact things, i could use something else.

do you think you could help me, please.. i would really appreciate it

also:

rate

for(rate = 5.0; rate <=8.0; rate=rate + 0.125)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.