• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

哪位高手能帮小弟我看看这是咋回事

php 搞代码 3年前 (2022-01-23) 11次浏览 已收录 0个评论

谁能帮我看看这是怎么回事?
代码如下:
<?php
function amortizationTable($pNum,$periodicPayment,$balance,$monthlyInterest)
{
$paymentInterest=round ($balance*$monthlyInterest,2);
$paymentPrincipal=round ($periodicPayment-$paymentInterest ,2);
$newBalance=round ($balance-$paymentPrincipal,2);
if ($newbalance < $paymentPrincipal){

……本2文来源gaodai.ma#com搞##代!^码@网3

搞代gaodaima码 $newBalance=0;
}

printf(“

%d

“,$pNum);
printf(“

$%S

“,number_format($newBalance,2));
printf(“

$%S

“,number_format($periodicPayment,2));
printf(“

$%S

“,number_format($paymentPrincipal,2));
printf(“

$%S

“,number_format($paymentInterest,2));
if($newBalance>0){
$pNum++;
amortizationTable($pNum,$periodicPayment,$newBalance,$monthlyInterest);
}else{
return 0;
}
}
$balance=10000.00;
$interestRate=.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);
$periodicPayment=round($periodicPayment,2);
echo”

“;
echo”

“;
aomrtizationTable($paymentNumber,$periodicPayment,$balance,$monthlyInterest);
echo”

Payment Number BalancePaymentPrincipalInterest

“;
?>
为什么显示的结果是下面的:

Fatal error: Call to undefined function aomrtizationTable() in C:\AppServ\www\test.php on line 38
Payment Number Balance Payment Principal Interest

——解决方案——————–
aomrtizationTable($paymentNumber,$periodicPayment,$balance,$monthlyInterest);
amo … 不是 aom
——解决方案——————–
注意大小写!

PHP code

function amortizationTable($pNum,$periodicPayment,$balance,$monthlyInterest) { $paymentInterest=round ($balance*$monthlyInterest,2); $paymentPrincipal=round ($periodicPayment-$paymentInterest ,2); $newBalance=round ($balance-$paymentPrincipal,2); if ($newBalance < $paymentPrincipal){ $newBalance=0; } printf("

%d

",$pNum); printf("

$%s

",number_format($newBalance,2)); printf("

$%s

",number_format($periodicPayment,2)); printf("

$%s

",number_format($paymentPrincipal,2)); printf("

$%s

",number_format($paymentInterest,2)); if($newBalance>0){ $pNum++; amortizationTable($pNum,$periodicPayment,$newBalance,$monthlyInterest); }else{ return 0; }}


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:哪位高手能帮小弟我看看这是咋回事

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址