Last active
March 3, 2022 15:25
-
-
Save ratulcse10/881ca7ee1e8368e5aa45fca0dea5b65e to your computer and use it in GitHub Desktop.
jibon_biman_calculation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Your code here! | |
$current_year=2022; | |
$amount_start = 20000; | |
$start_age = 30; | |
$pension_age = 60; | |
$inflation_rate = 6; | |
$amount = $amount_start; | |
for($i=0;$i<=($pension_age - $start_age);$i++){ | |
if ($i>0) $amount = $amount + $amount* $inflation_rate /100; | |
// echo $start_age+$i." - ".$amount."\n"; | |
} | |
$amount = round($amount,2); | |
echo "Pension We want to get\n"; | |
echo "Value at ".$current_year.": ".$amount_start."\n"; | |
echo "Value at ".$current_year+($pension_age - $start_age).": ".round($amount,2)."\n"; | |
$jibon_bima_rate = 84.50; | |
$premium_yearly = ($jibon_bima_rate/100)*$amount; | |
$premium_yearly_base = $premium_yearly; | |
$total_premium_paid=0; | |
echo "Yearly Premium : ".round($premium_yearly,2); | |
echo "\nMonthly Premium : ".round($premium_yearly/12,2); | |
for($i=0;$i<=($pension_age - $start_age);$i++){ | |
if ($i>0) $premium_yearly = $premium_yearly * 100 / (100+$inflation_rate); | |
//echo $start_age+$i." - ".$premium_yearly."\n"; | |
$total_premium_paid = $total_premium_paid + $premium_yearly; | |
} | |
$total_premium_paid_in_value= round($total_premium_paid,2); | |
echo "\nTotal Premium Paid:(In terms digit): ".round($premium_yearly_base*($pension_age - $start_age),2)."\n"; | |
echo "Total Premium Paid:(In terms value) of ".$current_year." : ".$total_premium_paid_in_value; | |
echo "\nProfit After:\n"; | |
$month=1; | |
$total_pension_get = 0; | |
while(1){ | |
$total_pension_get = $total_pension_get + $amount_start; | |
//echo $total_pension_get."\n"; | |
$month++; | |
if($total_pension_get>$total_premium_paid_in_value){ | |
echo "Total Years you have to be live: ".round($month/12,0)." & Months: ".$month%12; | |
break; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment