/*****************************************************************************
* Calculates the amount of principal after compounded interest is *
* earned. *
* Inputed: p (principal), n (# of years), c (# of times compounded) *
* i (APR % rate) *
* Outputed: i, n, a (interest earned in dollars) [see formula below] *
* Written: September 17, 2001 *
* By: Ronald Roberts *
*****************************************************************************/
//Program 5
//17SEP01
#include
#include
int main()
{
/* initiate variables */
double a=0, p=0, i=0, c=0, n=0;
/* prompted user input */
cout<<"Please Enter The Principal:"<>p;
cout<<"Please Enter The Number Of Years:"<>n;
cout<<"Please Enter The Number Of Times Compounded:"<>c;
cout<<"Please Enter The Interest Rate:"<>i;
i=i*0.01;
/* equation */
a=p*(pow((1+i/c), n*c));
/* output */
cout<<"The Amount After "<