作业帮 > 综合 > 作业

谁能帮小弟解答一道C语言题目

来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/14 01:52:36
谁能帮小弟解答一道C语言题目
Write a program that asks the user to type in two integer values at the terminal.The first number is the amount the user if going to borrow and the second is the monthly amount he can afford to pay.The loan interest rate is set to 18% per year (or 1.5% per month).The monthly payment covers the interest first and whatever is left is used to pay the remaining debt.
Your program should return the time (in years and or months) it will take to pay the loan.If the payment does not cover the interest,it should indicate so.See examples below
$1000 and $40 repayment should return "it will take 2 years and 8 months to pay the loan"
$1000 and $10 repayment should return "the monthly payment does not cover the loan"
英语学的不好,把题目翻译成中文