loan calculation

hi, i really need help on program, i messed up really bad. can anyone help me.

Here is what i have so far:

#include <iostream>
#include <iomanip>
using namespace std;
int main ()
{
double balance, payment, interest, apr, new_balance;
int month;
month=1;
cout << "Tell us your loan balance, your apr, and how much you intend to pay each month." << endl;
cin >> balance;
cin >> apr;
apr=apr/100;
interest=(apr/12)*balance;
cin >> payment;

cout.setf(ios::fixed);

cout.setf(ios::showpoint);

cout.precision(2);



cout<<setfill('-')<<setw(6)<<left<<"month"<<"\t"<<setw(6)<<"loan balance"<<"\t"<<setw(6)<<"interest"<<"\t"<<setw(7)<<"payment"<<setw(7)<<"\t"<<"new_balance"<<endl;
cout<<setfill('-')<<setw(5)<<right<<"\t"<<setw(6)<<"\t"<<setw(4)<<"\t"<<setw(6)<<"\t"<<setw(6)<<endl;

while(payment<=interest) {
cout<<"Please try again, input a payment larger than the interest"<<endl;
cin>>payment;




}
while (balance > 0) {
if(balance<=payment) {
payment=balance;

}


interest=5;
interest=interest*balance;
while (interest >= 1) {

interest= new_balance * (apr / 12.0);


//interest = interest/ 100;
}




//balance=new_balance;

cout<<month<<"\t"<<balance<<"\t"<<interest<<"\t"<<payment<<"\t"<<new_balance<<endl;

new_balance=balance + interest - payment;





balance= new_balance-payment ;


if(balance==0) {
new_balance=0;
} else {



}
month++;
}



}









i need to make it neat and organized and look like this:


f the desired monthly payment is larger, then your program should present a table of loan balance information:

Month Loan balance start Interest Payment Loan balance end
----- ------------------ -------- ------- ----------------
1 100000.00 500.00 1000.00 99500.00
2 99500.00 497.50 1000.00 98997.50
3 98997.50 494.99 1000.00 98492.49
...



Your report should continue until the loan balance at the end of the month is 0.00. This will mean that the final payment will be equal to the principal plus the interest for the final month.



please help me




update:

at the bottom where the table is , its suppose to be neat. sorry for any confusion.
You can just edit your post if you wanna update. Also, speaking of editing, do that and put all of your code between code tags <> under the format section. Code is unreadable like this.
Topic archived. No new replies allowed.