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

 

pay


Write a method named pay that accepts a real number for a salary and an integer for the number of hours were worked this week, and returns how much money to pay. For example, the call pay(5.50, 6) should return 33.0. There is "overtime" pay of 1 ½ normal salary for any hours above 8. For example, the call pay(4.00, 11) should return (4.00 * 8) + (6.00 * 3) or 50.0.


pay(5.5, 6) → 33.0
pay(4.0, 11) → 50.0
pay(10, 3) → 30.0

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

public double pay(double salary, int hours){ }

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

Java Help

Misc Code Practice

Difficulty: 100

Copyright Nick Parlante 2017 - privacy