I have to write a program that will calculate the monthly payment based on a total balance, APR, and finance period all of which are user inputs. My teacher gave us the equation payment = balance / (1 - (1 + interest)-n / interest). N is the number of months the finance period will last. Here's the catch; we are not allowed to use the math library to access exponents so I really have no clue what to do. He said something about using a loop but gave no specifics so I'm flying blind.
I've done nothing as far as the math but here's what I've written.
// Keenan Brown //
// Lab 2 //
// banker //
// 27 September 2012 ///
// This program will calculate monthly payments //
// based on the total balance, annual percentage rate, //
// and the how long payments will be made in months. //
# include <iostream> // Needed for stream I/O
# include <cstdlib> // Needed for system command, "clear"
# include <iomanip> // Needed for fixed decimal position