Try using this instead...
PHP Code:
<?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);
?>
Edit: Nevermind, the one above me beat me to the punch. LOL
Bookmarks