请问下面这个PHP程序 哪里错了? DW中提示 第25 41 43错误 程序如下

<?phpfunctionamortizationTable($pnum,$periodicpayment,$balance,$monthlyinterest){$pay... <?php
function amortizationTable($pnum,$periodicpayment,$balance,$monthlyinterest){ $paymentinterest = round($balance * $monthlyinterest,2); $paymentprincipal = round($periodicpayment - $paymentinterest,2); $newbalance = round($blance - $paymentprincipal,2); if($newbalance < $paymentprincipal) { $newbalance = 0; } printf("<tr><td>%d</td>",$pnum); printf("<td>$%s</td>",number_format($newbalance,2)); printf("<td>$%s</td>",number_format($periodicpayment,2)); printf("<td>$%s</td>",number_format($paymentprincipal,2)); printf("<td>$%s</td></tr>",number_format($paymentinterest,2)); if ($newbalance > 0) { $pnum++; amortizationTable($pnum,$periodicpayment,$newbalance,$monthlyinterest); } else { return 0; }
} $balance = 10000.00; $interestrate = 0.0575; $monthlyinterest = $interestrate / 12; $termlength = 5; $paymentsperyear = 12; $paymentnumber = 1; $totalpayments = $termlength * $paymentsperyear; $intcalc = 1 + $interestrate/$paymentsperyear; $periodicpayment = $balance * pow($intcalc,$totalpayments) * ($intcalc -1) / (pow($intcalc,$totalpayments) - 1); $payment = round($periodicpayment,2); echo "<table width='50%' align='center' border='1'>"; echo "<tr> <th>payment number</th><th>balance</th> <th>payment</th><th>principal</th><th>interset</th> </tr>" amortizationTable($paymentnumber, $periodicpayment,$balance,$monthlyinterest); echo "</table>"?>
这个程序主要是按揭还贷计算器,$pnum标识还款编号 $periodicpayment标识每月总的还款额 $balance标识剩余贷款额 $monthlyinterest指定了每月的利率 分不够了 请大家帮帮忙 真不明白 为什么这几行错了
展开
 我来答
windblast
2013-06-12 · 知道合伙人软件行家
windblast
知道合伙人软件行家
采纳数:5633 获赞数:13630
毕业于空军第一航空学院电子专业,1991年开始接触电脑,从事多年计算机编程,具有较丰富的经验。

向TA提问 私信TA
展开全部
如果你上面写的文字的代码,是你计算机上原样复制过来的,则可能的错误如下:

1. 第24行代码的 } 错误,你误输入的是中文的括号,你改成小写的英文括号就可以了。

2. 第40、42行,是比较明显的语法错误:缺少 ; 分号(PHP语句结束标识符)
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式