Oct 30, 2016 at 11:47pm UTC
#include<iostream>
#include<math>
#include<iomanip>
using namespace std;
double getPayment(int,double,int);
int main()
{
int carPrice=0,rebate=0,term=0;
double creditRate=0.0,dealerRate=0.0,creditPayment=0.0,dealerPayment=0.0;
cout << "car price:";
cin >> carPrice;
cout << "Rebate:";
cin >> rebate;
cout << "Credit Union rate:";
cin >> creditRate;
cout << "Dealer rate:";
cin >> dealerRate;
cout << "terms in years:";
cin >> term;
creditPayment=getPayment(carPrice-rebate,creditRate/12,term*12);
dealerPayment=getPayment(carPrice-rebate,dealerRate/12,term*12);
cout << fixed <<-setprecision(2) << endl;
cout << "Credit union payment: $" << creditPayment <<endl;
cout << "Total Pay under Credit Union is :" << creditPayment*12*term+reabte <<endl;
cout << "Dealer payment :$ " << dealerPayment << endl;
cout << "Total Pay under Dealer rate is :" << dealerPayment*12*term+rebate <<endl;
return 0;
}
double getPayment(int prin,double monthRate,int months)
{
double monthPay=0.0;
if(1-pow(monthRate+!,-months) ==0 )
return -1;
monthPay=prin * monthRate / (1- pow(monthRate +1 ,-months));
return monthPay;
}
error C1083: Cannot open include file: math: no such file or directory
IntelliSense: cannot open source file "math"
IntelliSense:no operator "-" mathese these operands
Can someone help me debug this program