Format and program.

You use the setprecision, setw and fixed manipulators defined in the <iomanip> header to control the formatting of numbers. Write a program that calculates the interest and principal payments on a simple loan. Your program should query the user for a percentage annual interest rate, an initial balance and monthly payment, then print out the following table:
Month Balance Interest Payment
1 $ 10050.00 $ 100.50 $ 500.00
2 $ 9650.5 $ 96.51 $ 500.00
3 $ 9247.01 $ 92.47 $ 500.00
4 $ 8839.48 $ 88.39 $ 500.00
Use setw to set each column width, and use fixed and setprecision to properly show dollars and cents.



Here is what I have so far:

#include <iostream>
#include <iomanip>
#include <math.h>
using namespace std;

int main()
{

cout << "Percentage annual interest rate: ";
int int_rate;
cin >> int_rate;

cout << "Initial Balance Payment: ";
int bal_pay;
cin >> bal_pay;

cout << "Monthly Payment ";
int month_pay;
cin >> month_pay;



}


Where do I go from here?
Topic archived. No new replies allowed.