#include <iostream>
usingnamespace std;
int main()
{
double face_value, interest, p_interest, duration, new_value;
char again;
do
{
cout << "Please enter the face value of loan:- $";
cin >> face_value;
cout << "Enter the interest rate:- ";
cin >> interest;
cout << "Enter the duration in years:- ";
cin >> duration;
interest = interest / 100;
p_interest = face_value * interest;
new_value = duration * p_interest;
face_value = face_value - new_value;
cout << " \n";
cout << "The amount you will get will be $" << face_value;
cout << " \n";
cout << " \n";
cout << "Do you want to recheck?\n";
cout << "Type y For Yes and N for No then press return key\n";
cin >> again;
} while ( (again == 'y') || (again == 'Y') );
return 0;
}
The second part is "the program should also calculate the monthly payment". So first question is "Am I gong right" and second "how to Calculate monthly payment?"
The second part is "the program should also calculate the monthly payment". So first question is "Am I gong right" and second "how to Calculate monthly payment?"
According to the description of what you need to accomplish, no. You're not going right. You were to ask the user for the amount they wanted to receive, not the face value of the loan. Enough information is given for you to determine the formula you need to use.
[Edit: The instructions give very clear directions now how to calculate the monthly payment.]