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

 

taxRate


Write a method called taxRate that takes salary (double) and returns the correct tax rate (integer). Salaries less than 9,275 have a 10% tax rate. Salaries equal to or above 9,275 but below 37,650 have a 15% tax rate. Salaries equal to or above 37,650 but below 91,150 have a 20% tax rate. Salaries at or above 91,150 but below 190,150 have a 25% tax rate. Salaries at or above 190,150 have a 33% tax rate.


taxRate(5000) → 10
taxRate(16123) → 15
taxRate(37650) → 20

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

public int taxRate(double salary){ }

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 Post-solution available

Copyright Nick Parlante 2017 - privacy