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));
?>
### 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));
?>