about | help | code help+videos | done | prefs |
Fill in the missing code in the totalWages method, which calculates the total earnings for a week based on the number of hours worked and the hourly rate. The pay for overtime (hours worked over 40) is 1.5 times the regular rate. (But only the hours worked above 40 get paid at the overtime rate). For example, totalWages(45, 12.50) should return 593.75. This is because: - 40 hours worked at 12.50 per hour is 500. - 5 hours worked at the overtime rate of 18.75 (12.5 * 1.5) per hour is 93.75 The sum of 500 and 93.75 is 593.75. totalWages(45.0, 12.5) → 593.75 totalWages(8.0, 10.0) → 80.0 totalWages(40.0, 9.5) → 380.0 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 120
Copyright Nick Parlante 2017 - privacy