#include <iostream>
using namespace std;

int main()
{
	double monthlyPayment;
	double balance;
	double interestRate;
	int month = 1;

	cout.setf(ios::fixed);	// These lines force currency format in output to 2 decimal pts
	cout.setf(ios::showpoint);
	cout.precision(2);

	cout << "Enter the current balance of your loan: $";
	cin >> balance;
	cout << "Enter the interest rate (compounded monthly) : ";
	cin >> interestRate;
	cout << "Enter the desired monthly payment : $";
	cin >> monthlyPayment;
	
	while (interestRate >= 1)
	{ 
		interestRate = interestRate / 100; 
	}

	balance = balance * (1 + interestRate / 12) - monthlyPayment;
		
        // this is where the program stops. 

	cout << "After month 1 your balance is $" << balance << endl;

	while (balance > 0)
	{
		balance = balance * (1 + interestRate / 12) - monthlyPayment;
		
		month = month++;

		cout << "After month " << month << ", your balance is : $" << balance << endl;
	}

	cout << "You have paid off the loan at this point. Congratulations!" << endl;


	return 0;