#include <cstdlib>
#include <iostream>
#include <cmath>
using namespace std;
int main(int argc, char *argv[])
{
double amount, rate, time, interest, month;
interest = rate/(12.0*100);
month = (amount * rate)/1.0 -(1.0 + interest), pow(time*12);
cout << "What is the amount of the loan? $ ";
cin >> amount;
cout << "What is the annual percentage rate? ";
cin >> rate;
cout << "How many years will you take to pay back the loan? ";
cin >> time;
cout <<"\n-------------------------------------------------------\n";
cout << "Amount Annual % Interest Years Monthly Payment\n\n\n";
cout <<amount <<" " <<rate <<" " <<time << " " <<month;
cout <<"\n\n";
system("PAUSE");
return EXIT_SUCCESS;
}
Я получаю сообщение об ошибке здесь и не знаю точно, как правильно использовать функцию pow. Формула в соответствии с проблемой является:Силовая функция C++ с переменными
Monthly payment = (loan amount)(monthly interest rate)/1.0 - (1.0 + Monthly interest rate)^-(number of months)
Вот строка, что у меня возникли проблемы с
месяца = (сумма * скорость) /1.0 - (1,0 + проценты), Пау (время * 12);
Спасибо за помощь
Какая «проблема у вас есть»? – 2013-03-10 08:27:37
Какая ошибка вы спрашиваете? –
Должен ли вы рассчитать ежемесячный платеж * после * у вас есть значения для всех других переменных? –