一道有点难度的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

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/28 03:23:39
一道有点难度的C语言题目Writeaprogramthataskstheusertotypeintwointegervaluesattheterminal.Thefirstnumberistheamo

一道有点难度的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
一道有点难度的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"

一道有点难度的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
编写一个程序,要求用户输入两个整数值.第一个数字用户借钱金额,二是每月他可以负担得起的金额.贷款利率设定为18%每年(或每月1.5%).每月支付的利息包括无论是否用来支付利息.

你的程序应返回(以年或月)时,将采取支付贷款方式.是否包括支付的利息.见下面的例子

借1000美金 每个月还40美金,需要2年8个月才能还请.

借1000美元 每月还10美元(不包括还利息)