Expand|Select|Wrap|Line Numbers
- /*Header Section*/
- #include "stdafx.h"
- #include <iostream>
- #include <math.h>
- #include <limits>
- using namespace std;
- /*End Header Section*/
- int _tmain(int argc, _TCHAR* argv[])
- {
- double LoanAmount ;
- double InterestRate ;
- double TermInMonths ;
- int i = 0 ;
- int Years;
- int quit = 0;
- do
- {
- // input loan amount
- while ((std::cout << "Enter Loan amount without decimals: ")
- && (!(std::cin >> i) || i < 1 || i > 999999999));
- } {
- std::cout << "That's not a number between 1 and 999999999; ";
- std::cin.clear();
- std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
- // input interest rate
- cout << "Enter interest rate(%): (Format 5.70 for 5.70%) " ;
- cin >> InterestRate;
- // input mortgage term
- cout << "Enter terms of mortgage in years: ";
- cin >> Years;
- InterestRate = InterestRate / 100 ;
- TermInMonths = Years * 12 ;
- // monthly payment calculation formula
- double payment = LoanAmount * (( InterestRate/12)/(1-pow( 1 / ( ( 1 + InterestRate / 12 ) ) , TermInMonths ) ) );
- cout << "\nLoan Amount:\t$" << LoanAmount << endl;
- cout << "Interest Rate:\t" << InterestRate*100 << "%" << endl;
- cout << "Terms in Months:\t" << TermInMonths << endl;
- // display the payment amount
- cout << "Monthly Payment:\t$" << payment << endl;
- cout << "\n1. Enter new data" << endl;
- cout << "2. Quit" << endl;
- cout << "Select a choice: ";
- cin >> quit;
- while ( quit != 2 );
- return 0;
- }
...er.cpp(25): error C2059: syntax error : '{'
...er.cpp(25): error C2143: syntax error : missing ';' before '{'
...er.cpp(59): fatal error C1075: end of file found before the left brace '{' at 'c:\users\charles i. clay\desktop\prg 410\er\er\er.cpp(13)' was matched
1>
1>Build FAILED.
I am completely lost as i've gone over it a million times.