# Field Manual for Hackers

## PHP - A bank offers 14%,15% and 16% interest on 1 year , 2 year and 3 year deposit. Write a programme to enter rate, deposit amount. compute and print maturity amount.

1. ";
\$time=\$_POST['time'];
echo "The time period is: \$time years";
echo "
";

if(\$time==1)
{
echo "Rate of Interest is 14%";
echo "
";
\$rate_dep_amt=14*\$amount/100;
\$maturity_amt=\$amount+\$rate_dep_amt;
echo "Rate Deposit Amount is: ".\$rate_dep_amt;
echo "
";
echo "Maturity Amount is: ".\$maturity_amt;
echo "
";
}

elseif(\$time==2)
{
echo "Rate of Interest is 15%";
echo "
";
\$rate_dep_amt=15*\$amount/100;
\$maturity_amt=\$amount+\$rate_dep_amt;
echo "Rate Deposit Amount is: ".\$rate_dep_amt;
echo "
";
echo "Maturity Amount is: ".\$maturity_amt;
echo "
";
}

elseif(\$time==3)
{
echo "Rate of Interest is 16%";
echo "
";
\$rate_dep_amt=16*\$amount/100;
\$maturity_amt=\$amount+\$rate_dep_amt;
echo "Rate Deposit Amount is: ".\$rate_dep_amt;
echo "
";
echo "Maturity Amount is: ".\$maturity_amt;
echo "
";
}

else
{
echo "Wrong Input";
echo "
";
}
?>

2. This comment has been removed by the author.

3. \$principalAmt=\$_POST["n1"];
\$time=\$_POST["n2"];
switch(\$time)
{
case 1: echo \$principalAmt+\$principalAmt*0.14;
break;
case 2: \$principalAmt=\$principalAmt+\$principalAmt*0.14;
echo \$principalAmt+\$principalAmt*0.15;
break;
case 3: \$principalAmt=\$principalAmt+\$principalAmt*0.14;
\$principalAmt+=\$principalAmt*0.15;
echo \$principalAmt+\$principalAmt*0.16;
break;
default: echo "Time period non acceptable";
break;
}

4. php
\$principalAmount=\$_POST['amount'];
\$time=\$_POST['time'];
switch(\$t)
{ case 1:
\$principalAmount=\$principalAmount+\$principalAmount*0.14;
echo "\$principalAmount";
break;
case 2:
\$principalAmount=\$principalAmount+\$principalAmount*0.14;
\$principalAmount=\$principalAmount+\$principalAmount*0.15;
echo"\$principalAmount";
break;
case 3:
\$principalAmount=\$principalAmount+\$principalAmount*0.14;
\$principalAmount=\$principalAmount+\$principalAmount*0.15;
\$principalAmount=\$principalAmount+\$principalAmount*0.16;
echo"\$principalAmount";
break;
default: echo " case is not possible";
}