*2.20(金融应用:计算利息)如果知道余额和年利率百分比,就可以使用下面的公式计算下个月的利息:
利息 = 余额 * (年利率百分比 / 1200)
编写程序,读取余额和年利率百分比,打印下个月的利息。下面是一个运行示例:
Enter balance and interest rate (e.g.,3 for 3%):1000 3.5
The interest is 2.91667
*2.20(Financial application: calculate interest) If you know the balance and the annual percentage interest rate, you can compute the interest on the next monthly payment using the following formula:
interest = balance * (annualInterestRate/1200)