How much did your meeting cost?

<?php
### meeting length is in hours
$meeting_length = 8;
### This array contains each employees salary
$a_amounts = array("35029","20303","83802","38250","92038","28383","10320");

function get_hourly_rate($amount)
{
        $monthly = $amount / 12;
        $weekly = $monthly / 4;
        $daily = $weekly / 5;
        $hourly = $daily / 8;
        return $hourly;
}

function get_meeting_cost($a_amounts,$meeting_length)
{
        $today = 0;
        foreach($a_amounts as $k=>$v)
        {
                $today = get_hourly_rate($v) * $meeting_length;
                $a_how_much[] = $today;
        }
        $how_much = array_sum($a_how_much);
        $how_much = round($how_much,2);
        return "Your meeting cost: \$" . $how_much;
}

print(get_meeting_cost($a_amounts,$meeting_length));
?>

Page Comments (Click to edit)






[Click to add or edit comments])

Please prepend comments below including a date

Design by N.Design Studio, adapted by solidGone.org (version 1.0.0)
Have a nice day.