t********n 发帖数: 611 | 1 自学编程遇到困难,哪位前辈帮忙看看:
问题是:要求写一个程序,计算如果每月还固定金额,一年把信用卡债务还清,每月需
要支付多少钱,前提是这一年都不再使用信用卡借债。要求用bisection
lower bound= outstanding balance/12
upper bound=( outstanding balance (1+monthly interest rate)**12)/12
以下是问题link:
http://ocw.mit.edu/courses/electrical-engineering-and-computer-
第3题不会做,我写的程序是这样的:
initialBalance= float (raw_input ('Enter the outstanding balance:'))
annualInterest= float (raw_input('Enter the annula interest rate'))
monthlyInterest= annualInterest/12.0
lower= initialBalance/12.0
upper= ... 阅读全帖 |
|