I re-wrote the script from the other day to make it a MATLAB function.
function sev_pack = enron_sev(years_served,end_salary);
% Given current salary and number of years served, calculates the severance
% package according to Enron's formula
% Enron's formula is as follows:
% Two weeks pay for every year served + two weeks pay for every $10,000
% of base salary
floor_years_served = floor(years_served);
base_salary_factor = floor(end_salary/10000);
% Assume 52 weeks in a year
two_weeks_pay = end_salary / 26;
sev_pack = two_weeks_pay * (floor_years_served + base_salary_factor);
No comments:
Post a Comment