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

 

jebbert@volusia.k12.fl.us > salary
prev  |  next  |  chance

Write a method that has three parameters: hours, an integer representing how many hours you worked that week; payRate, an integer representing how many dollars per hour you make when you are not getting payed overtime; and overtime, a boolean variable that is true if you get payed double for the hours you work over 40, or false if you only get your regular pay rate when you work over 40 hours. Return the total pay in dollars that you should get for that week. Pay, pay rate, and hours worked, will all be in whole number amounts.


salary(15, 5, true) → 75
salary(40, 10, true) → 400
salary(42, 10, true) → 440

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

public int salary(int hours, int payRate, boolean overtime) { }

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: 250

Copyright Nick Parlante 2017 - privacy