Negotiating a consumer loan is not always straightforward. One form of loan
is the discount installment loan, which works as follows. Suppose a loan has a face
value of $1,000, the interest rate is 15%, and the duration is 18 months. The interest is computed by multiplying the face value of $1,000 by 0.15 to yield $150. That figure is
then multiplied by the loan period of 1.5 years to yield $225 as the total interest owed.
That amount is immediately deducted from the face value, leaving the consumer with
$775. Repayment is made in equal monthly installments based on the face value. So the
monthly loan payment will be $1,000 divided by 18, which is $55.56. This method of
calculation may not be too bad if the consumer needs $775 dollars, but the calculation is a
bit more complicated if the consumer needs $1,000. Write a program that will take three
inputs: the amount the consumer needs to receive, the interest rate, and the duration of
the loan in months. The program should then calculate the face value required in order
for the consumer to receive the amount needed. It should also calculate the monthly
payment. Your program should allow the calculations to be repeated as often as the user
wishes.
I dont know how to calculate the face value!!
I did this but there's an obvious error on the algorithm
#include <iostream>
using namespace std;
int main()
{
double money_needed, face_value, interest_rate, number_of_months, monthly_payment, time, interest;
int const year = 12, percent_decimal = 100;
char ans;
do
{
cout << "Enter the amount of money you need from a loan.\n";
cin >> money_needed;
cout << "Enter the interest rate of the loan in percentage.\n";
cin >> interest_rate;
cout << "Now enter the duration of the loan in months.\n";
cin >> number_of_months;
interest = interest_rate / percent_decimal;
time = number_of_months / year;
face_value = (1 + money_needed) / (interest_rate * time);
monthly_payment = face_value / number_of_months;
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(2);
cout << "Your face value is " << face_value << ".\n";
cout << "That means that your monthly payment would be " << monthly_payment << ".\n";
cout << "Do you want to do it again?\n";
cout << "Press y for yes, press n for no: ";
cin >> ans;
} while (ans == 'y' || ans == 'Y');
cout << "Goodbye!\n";
return 0;
}
Anyone can help me?