Trying a payroll line

I am confused on how I go about doing this. How would I go about entering something like this? And can someone please help me understand double-alternative if header please?

DOUBLE-ALTERNATIVE IF HEADER:

A-1-3-14) IF employee did not work overtime THEN

A-1-3-15) ASSIGN value of expression (hoursWorked MULTIPLIED BY hourlyPayRate) TO variable grossPay

A-1-3-16) ELSE

A-1-3-17) ASSIGN value of expression (c_maximumHoursWorkedWithoutOvertimePay MULTIPLIED BY hourlyPayRate

A-1-3-18) PLUS (hoursWorked MINUS c_maximumHoursWorkedWithoutOvertimePay)

A-1-3-19) MULTIPLIED BY hourlyPayRate MULTIPLIED BY c_overtimePayRatePremium) TO grossPay
Last edited on
confused?!?

This one is pretty strait:
A-1-3-14) IF employee did not work overtime THEN
1
2
     if(hoursWorked < overtimeMax)
     { // then start.... 

again pretty strait foward....
A-1-3-15) ASSIGN value of expression (hoursWorked MULTIPLIED BY hourlyPayRate) TO variable grossPay
1
2
3
4
          grossPay = /*assign*/ hoursWorked * /*Multiplyed by*/ hourlyPayRate;
      } // end the then block....
      else // pretty strait forward
      { // begin the else block. 


again simple stuff again....
A-1-3-17) ASSIGN value of expression (c_maximumHoursWorkedWithoutOvertimePay MULTIPLIED BY hourlyPayRate

A-1-3-18) PLUS (hoursWorked MINUS c_maximumHoursWorkedWithoutOvertimePay)

A-1-3-19) MULTIPLIED BY hourlyPayRate MULTIPLIED BY c_overtimePayRatePremium) TO grossPay

1
2
3
4
5
6
7
8
9
10
11
12
13
             // A-1-3-17) ASSIGN value of expression(c_maximumHoursWorkedWithoutOvertimePay MULTIPLIED BY hourlyPayRate
             // this is covered by the next two lines...
              
            // the hours over overTimeMax
              overtimehrs =/* assign */ hoursWorked - overtimeMax;
            // build the base of grossPay...  
              grossPay = overTimeMax * hourlyPayRate;

              // the Rate increase is like 1.5x for some hrs, or 2.0 for double time if this the american standard.  
              //(there might be another block of information needed to decide...)

              grossPay = grossPay + overtimehrs * (hourlyPayRate*RateIncrese);
        }// the else block 


Why was this so hard? What was so confusing about your pseudo code?
Last edited on
Topic archived. No new replies allowed.