Legato213
10-12-2008, 06:57 PM
hello, im pretty new to php and i have to write a little program for my computer class but no matter what i do i get the error. help much appreciated the unexpected error is on like 14, 20, 26.
<?php
$loanamount = 0.0;
$deposit = 0.0;
$totalcost = 0.0;
printf("\nEnter Desired Loan Amount: ");
fscanf(STDIN, "%f", $loanamount);
if($loanamount > 0 && $loanamount < 25000 );
{
$deposit = $loanamount * .05;
}
else
{
if($loanamount >= 25000 && $loanamount < 50000 );
{
$deposit = ($loanamount - 25000) * .10;
}
else
{
if($loanamount >= 50000 && $loanamount <= 100000);
{
$deposit = ($loanamount - 50000) * .25;
}
else
{
if ($loanamount <= 0 || $loanamount > 100000);
{
printf("\n The amount requested is beyond the acceptable value. Please enter an amount between $0 and $100000");
}
}
}
}
printf("\nYour deposit will be %.2f",$deposit);
$totalcost = $loanamount + $deposit;
printf("\nYour total loan cost will be %.2f",$totalcost);
?>
<?php
$loanamount = 0.0;
$deposit = 0.0;
$totalcost = 0.0;
printf("\nEnter Desired Loan Amount: ");
fscanf(STDIN, "%f", $loanamount);
if($loanamount > 0 && $loanamount < 25000 );
{
$deposit = $loanamount * .05;
}
else
{
if($loanamount >= 25000 && $loanamount < 50000 );
{
$deposit = ($loanamount - 25000) * .10;
}
else
{
if($loanamount >= 50000 && $loanamount <= 100000);
{
$deposit = ($loanamount - 50000) * .25;
}
else
{
if ($loanamount <= 0 || $loanamount > 100000);
{
printf("\n The amount requested is beyond the acceptable value. Please enter an amount between $0 and $100000");
}
}
}
}
printf("\nYour deposit will be %.2f",$deposit);
$totalcost = $loanamount + $deposit;
printf("\nYour total loan cost will be %.2f",$totalcost);
?>