448,574 Members | 1,205 Online Need help? Post your question and get tips & solutions from a community of 448,574 IT Pros & Developers. It's quick & easy.

# Compound Interest with recursion help

 P: 16 I need to make a program that calculates Compound Interest (compounded monthly). Thing is, it has to use recursion. I don't know how to implement it in though. This is the code i have so far. Expand|Select|Wrap|Line Numbers #include #include using namespace std;   float initialDeposit=0; int depositMonth=0; float interestRate=0; float total=0; void mainFunction(); void endingBalance(); bool goAgain();   int main() {     do{     system("cls");     mainFunction();     endingBalance();       }while(goAgain());     cin.get();     cin.get();     return 0; }   void mainFunction(){     cout<<"What is the initial deposit? ";     cin>>initialDeposit;     cout<>depositMonth;     cout<>interestRate;     cout<> answer;         while(answer != 'y' && answer != 'Y' && answer != 'n' && answer != 'N')     {       cout << "Invalid choice.  Would you like to go again?";       cin >> answer;     }       cout << endl;         if(answer == 'y' || answer == 'Y')       return true;     else       return false; }    Feb 15 '07 #1 