id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

burns@bxscience.edu burnscfa > grossPay
prev  |  next  |  chance

if-else practice: An employee typically works 40 hours per week. If they work over 40 hours per week they get paid 1.5 times their regular pay for all hours over 40. Complete the following function which will return their gross pay which includes overtime. Return floating point numbers. Hint:gross pay = (regular hours * pay rate) + (over time hours * pay rate * 1.5)


grossPay(40.0, 20) → 800.0
grossPay(50.0, 30) → 1650.0
grossPay(30.0, 20) → 600.0

...Save, Compile, Run (ctrl-enter)

def grossPay(hours, rate):

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Python Help

Difficulty: 100

Copyright Nick Parlante 2017 - privacy