Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

please help...completely lost. this exercise, you will modify the car payment pr

ID: 3804531 • Letter: P

Question




please help...completely lost.

this exercise, you will modify the car payment program from Lab 9-2. necessary. create a new project named rntermediatel9.cpp. from 9 Project, and save it in the Cpp8 the cpp file into a source file named (Alternatively, you can enter the instructions from Figure 9-34 the Intermediatel9.cpp file.) Change the filename the first comment. Make the modifications listed in Figure 9-39. Test the program in appropriately i Before calculating a monthly payment, verify that the denominator in payment formula is not the number 0. If it is 0, the function should return the number -1 (the negative number 1). 2. In addition to displaying the monthly payments, the program should also display the following two amounts: a. The total amount the user will pay for the car it the loan is financed through the credit union. b. The total amount the user will pay for the car if the loan is financed through the car dealer Figure 9.39

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.