Scientific Calculator

(public) gssymeon/Personnel

By gssymeon George

Calculates the number of personnel need to cover shifts

Tagged: personnel shifts

var Personnel = function ()
{
      var pc = "";
      var output = [];
      pc = prompt("Number of Shifts Required", "Personnel", "3");
      var shift = number(pc);

      pc = prompt("Number of Persons per Shift","Personnel","2");
      var per = shift*number(pc);

      pc = prompt("Number of Days to Work","Personnel","5");
      var days = number(pc);
      var week = days*per;

      pc = prompt("Vacation Days per Year","Personnel","25");
      var vac = number(pc);
      pc = prompt("Holidays per Year","Personnel","10");
      var hol = number(pc);

      var wdy = (52*5) - (vac+hol);
      push(output,concat("Work Days: ", string(wdy)));

      var perweek = round((week / 5) + 0.5);
      push(output,concat("Persons per Week: ", string(perweek)));

      var rper = ((per*days*52) / wdy)+0.5;
      push(output,concat("Personnel Required: ", string(rper)));
      output;
};

spam? | offensive?

0 Comments

Sign in to leave a comment