Skip to content

Latest commit

 

History

History
20 lines (13 loc) · 1023 Bytes

readme.md

File metadata and controls

20 lines (13 loc) · 1023 Bytes

Create a weeklyWage function

Create the weeklyWage function (in the weekly_wages.js file) that calculates the weekly wages for workers at the Kamva's cattery. It takes in a list of daily hours worked and needs 7 entries in the timesheet comma delimited parameter. If not the functions returns 'missing days'. If all the days are specified the weekly wage is returned for the specified parameters.

There are three user bands A, B & C each with a different hourly rate.

Band Description Hourly Rate
A New casuals 23
B Established casuals 37
C Supervisors 51

If an invalid user band is returned this function should return 0.

Calling the function looks like this: weeklyWage('A', '0,0,3,4,4,4,6'); This is an invalid call to the function as there are not 7 days in the 2nd parameter: weeklyWage('D', '0,0,3,4,4');

Look at the code in the unit test to see what is required.

Write the weeklyWage function to make the tests pass.