Hi I need help with the following project please The LENDER
Hi I need help with the following project please!
The LENDER Bank The LENDER Bank offers mortgages on homes valued up to $500,000. The required down payment is calculated as follows: 4% of the first $60,000 borrowed 8% of the next $30,000 borrowed 10% of the rest The amount borrowed cannot exceed 50% of the value of the house. Write a n interactive program (no environment division) to accept input from the keyboard that specifies for each borrower the amount that he or she wishes to borrow along with the price at which the house is valued. Based on the data entered, display the following: 1. A message that indicates if the amount the user wishes to borrow is acceptable (no more than 50% of the house value). 2. A message that indicates if the value of the house is acceptable (does not exceed $500,000). 3. A message dis playing the required down payment, if the amount to be borrowed is acceptable. When the amount to be borrowed is not acceptable, the program must not calculate or display the required down payment. For example, let’s assume that a borrower wants a loan for $100,000 on a house valued at $200,000. The maximum amount that can be borrowed is $100,000 (50% of $200,00 0 ) and as such the requested amount is acceptable. Therefore, the program should display a message indicating that the requested amount is acceptabl e and another message indicating that value of the house is also acceptable . The program should also indicate that the required down payment is $5,800 (60,000 x 4% + 30,000 x 8% + 10,000 x 10%). Please note that the program must only indicate the down payment amount, numbers in parenthesis are provided for illustrative purposes. However, if the requested amount was greater than $100,000 (such as $100,001), the program must display a message indic ating that the requested amount is not acceptable because it exceeds 50% of the value of the house , must display a message indicating that the value of the house is acceptable, and must not display or calculate the down payment . Also, if the value of the h ouse is greater than $500,000, the program must display a message indicating that the value of the house is not acceptable as it exceeds the maximum allowable amount.
Solution
#include<stdio.h>
float downpay(float );
main()
{
int n;
float br,hv,dp;
printf(\"Enter the no. of borrowers\ \");
scanf(\"%d\",&n);
while(n>0)
{
printf(\"what is the value of the home?\ \");
scanf(\"%f\",&hv);
printf(\"how much amount want to request to borrow?\ \");
scanf(\"%f\",&br);
if(hv>500000)
{
printf(\"your house value is high and requeste is not accepted!\ \");
break;
}
elseif(br<=(hv/2))
{
printf(\"your request for borrowed amount is accepted\ \");
dp=downpay(br);
printf(\"required downpayment is %f\",dp);
}
else
{
printf(\"your borrow request is not accepted because it is higher than the 50% of your house value!!!\ \");
break;
}
n--;
}
}
float downpay(float br)
{
float dp,a,b;
a=4/100*60000;
b=8/100*30000;
dp=10/100*(br-(a+b));
return dp;
}

