please help...completely lost. this exercise, you will modify the car payment pr
ID: 3804531 • Letter: P
Question
please help...completely lost.
Explanation / Answer
So basically we need to implement getPayment function here which will return -1 if denominator is 0 in the monthly payment formula,
getPayment(int price, double rate, int term) // Function definition
{
if(term==0)
return -1; // if term is 0 -1 will be returned
double monthlyPayment= pow(1+(price*rate), term)/term; // This formula will calculate monthly payment required
return monthlyPayment;
}
Just copy paste this function in your 9-34 code, it will work.
If this doesn't help, please reply in the comment I will try to help.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.