Help starting a C program with functions

I have a problem that has to be an interactive programs that accepts values for loan amount, yearly interest rate, and monthly payment amount from the terminal and then computes and displays on the monitor screen a loan repayment table. I have no idea how to start. I have to use at least one function but I'm not sure what needs to be a function or how many I need. Or how do I make a table that computes and displays the

loan table? Do I have to come up with a function? I don't want you to do it for me but instead kinda walk me through what I should do.

Here's the program's sample output:

Problem Statement: Develop an interactive program that accepts values for loan amount, yearly interest rate, and monthly payment amount from the terminal and then computes and displays on the monitor screen a loan repayment table. Implementation Details:

Monthly interest is computed on the beginning balance as

(beginning balance) * (interest rate)/12

Principal is obtained by subtracting monthly interest from monthly payment.

Ending balance is beginning balance minus principal paid.

The beginning balance for a month is the same as the ending balance for the previous month.

When the beginning balance for a month becomes less than or equal to the monthly payment amount, no interest is charged and the monthly payment is considered as the principal amount. In this case the monthly payment will be the final payment on the loan.

If the entered value for monthly payment is less than the computed monthly interest, the loan will never be repaid. Therefore, your program should print a message telling the user that the monthly payment is too small and asking the user to enter a larger value.

Output Example: Your program execution should have the same layout.

Enter loan amount: 10000

Enter yearly interest rate: 0.1790

Enter monthly payment: 30.00

***> Monthly payment is too small.

Enter monthly payment: 1000.00

LOAN REPAYMENT TABLE

Beginning Balance Payment Interest Principal Ending Balance

-------------------------- ----------- ------------- ------------ - --------------------

10000.00 1000.00 149.17 850.83 9149.16

9149.16 1000.00 136.47 863.52 8258.64

…………………..

…………………..

897.21 897.21 0.00 897.21 0.00 -

------------------------------------------------------------------------------------------------

Source code that I've written

I still don't know much about how to incorporate functions. I look in my textbook and at my class notes but still no progress. Here's what I have with functions or parameters. It's not quite finished but maybe you can help me critique what I have thus far. The program I have to write is on my first post.

Code:

`#include <stdio.h>`

int main (void)

int amount, yrinterest, monthly;

float beginningbalance, principal, newamount, interest, payment;

printf ("Enter loan amount : ");

scanf ("%d", &amount);

printf ("Enter yearly interest rate: ");

scanf ("%d", &yrinterest);

monthly = yrinterest/ 12;

yrinterest = amount * monthly;

printf ("Enter monthly payment: ");

scanf ("%d", &monthly);

If yrinterest >= monthly

printf ("Monthly payment is too small.");

scanf ("%d", &monthly);

printf ("Enter monthly payment:");

Printf("Loan Repayment Table");

beginningbalance=1

While (beginningbalance > payment) {

Principal = Payment - Interest;

Newamt = Amount - Principal;

Printf ("Beginning Balance \t%f", beginningbalance);

Printf ("Payment \t%f", amount);

Printf ("Interest \t %f", interest);

Printf ("Principal \t %f", principal);

Printf ("Ending Balance \t %f", newamt);

amount=newamt;

beginningbalance=beginningbalance +1;

}

Payment = amount + interest;

Interest = amount * monthly;

return 0;

}

**[EDIT]For what it's worth... code tags added by Hammer.**