Adding a scoll list


I am adding to the program a scoll list (12 lines at a time).   I can not get the program to run.  Please help.  Thank you
#include <iomanip>
  #include <math.h>
  #include <string>
  #include <iostream>
  #include <stdlib.h>

//Start of program
  using namespace std;
  int main(void)
  {
 
// Set up required variables  
    double  loanAmount; // loan amount                      
    int Years;          // Years of loan                      
    int term;           // Loan term
    int month = 12;     // 1 year = 12 months
    double  IntRate;    // Interest rate                    
    double MonthRate;   // Months of loans
    double MonthTerm;   // Term of loan
     char choice;

     while (true)
     {
//Infomation need for Monthly Mortgage Payment

           cout << "Enter the loan amount in dollars: ";
           cin >> loanAmount;
   
           cout << "Enter the loan term in years: ";
           cin >> Years;
   
           cout << "Enter the interest rate: ";
           cin >> IntRate;

// Calculate Monthly Mortgage Payment
   
          MonthTerm = Years * 12;          
          MonthRate = IntRate / (12 * 100);
 
          double PowCalc = pow(1+MonthRate,MonthTerm);
          double paymentAmount = ((MonthRate*PowCalc) / (PowCalc-1)) * loanAmount;

         cout << fixed << showpoint;            //Decimal Function
         cout << setprecision(2);              //Set Number of Decimals places

//Information give on  Monthly Mortgage Payment
      system("cls");
      cout << endl;   //space
      cout << "Loan amount of $" << loanAmount << endl;
      cout << endl;   //space
      cout << "For a term of " << Years << " years" << " (" << Years*12 << " months)" << endl;
      cout << endl;   //space
      cout << "With an interest rate of " << IntRate << "%" << endl;
      cout << endl;   //space
      cout << "Monthly mortgage payment of $" <<paymentAmount << " per month." << endl;
//Quit or Continues (Loop)  
       do
//Produce a listing for each month
      monthly_payment = amount;
      for (month=1; month<term_months + 1; month++)      
      {
//Information give on  Monthly Mortgage Payment
      system("cls");
      cout << endl;   //space
      cout << "Loan amount of $" << loanAmount << endl;
      cout << endl;   //space
      cout << "For a term of " << Years << " years" << " (" << Years*12 << " months)" << endl;
      cout << endl;   //space
      cout << "With an interest rate of " << IntRate << "%" << endl;
      cout << endl;   //space
      cout << "Monthly mortgage payment of $" <<paymentAmount << " per month." << endl;        
     
// pause output every twelve lines, except for the final output
         if (month % 21 == 0 && month % term_months != 0)
               {  
                    system("pause");
                    system("cls");
         }// end if
      }// end for

     cout << "Would you like to perform another calculation? ";
     cin >> choice;
    } while (choice == 'Y' || choice == 'y');
    return 0;
   
}
Shannon3077Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DrAskeCommented:
missing declaration for three variables ..
monthly_payment ,  amount, and term_months
and missing right prantheses before *return 0*

regards, DrAske;
DrAskeCommented:
and left prantheses after keyword *do* ..
B1-66ERCommented:
Hi Shannon3077.
>>I can not get the program to run.
Infortunately, there are a lot of errors, see below:

1.

   while (true)
   {
//Infomation need for Monthly Mortgage Payment

change on:

  do
  {

and remove unneeded "do" from:

//Quit or Continues (Loop)  
    do

2. Remove:

//Produce a listing for each month
     monthly_payment = amount;

and rename variable month :

 int month = 12;   // 1 year = 12 months

on months:

 int months = 12;   // 1 year = 12 months

3.
Change your "for" cycle,

  for (month=1; month<term_months + 1; month++)    
     {
//Information give on  Monthly Mortgage Payment

according to changes you have made:

  for (int month=1; month<months + 1; month++)    
     {
//Information give on  Monthly Mortgage Payment

4. Rename variable "term_months" on "months" (they have same values, and meaning).
PMI ACP® Project Management

Prepare for the PMI Agile Certified Practitioner (PMI-ACP)® exam, which formally recognizes your knowledge of agile principles and your skill with agile techniques.

DrAskeCommented:
>>do
>>{

>>and remove unneeded "do" from:

>>//Quit or Continues (Loop)  
>>    do
then you have to remove

while (choice == 'Y' || choice == 'y');
DrAskeCommented:
discard my comment :)
B1-66ERCommented:
>>then you have to remove

No :)
i propose to change line

while (true)
  {
//Infomation need for Monthly Mortgage Payment

on:

 do
 {

then second "do" became unneeded.
DrAskeCommented:
I noticed that :)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C++

From novice to tech pro — start learning today.