This code is not working. I need the user to enter a number, I need the program to convert that number into a percentage/decimal and then later convert that percentage back to a dollar amount or whole number again. This is what I used for code so far which is not working.
Int main()
float dowpay; //down payment
float price; //price of home
float percon; //payment converted to percentage
float amtdwn; //down payment percentage time the price of the home.
percon = downpay * 0.01,
amtdwn = percon * price,
so this is what I have so far well a little of it anyway, I then need to figure this as a 15,30 and 40 year loan as well. Any help will be appreciated.
From what I can see you are only getting 1 percent of the payment.
What you need to do is work out how many months in the years that you want the loan for. This should be easy for you. Have them as constants.
Then using the percentage that needs to be repayed every month, calculate the amount by the percentage and use that as the monthly repayment.
Then multiply this amount by the amount of months to get the total amount of payment required to pay back the loan.
I am not sure what you are trying to do, but that should at least help you.