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

 

frew@mclean.com > tax
prev  |  next  |  chance

A new tax law has just been passed by the government:
• the first $3,000 of income is free of tax,
• the next $5,000 is taxed at 10%,
• the next $20,000 is taxed at 20%,
• the rest is taxed at 30%.


tax(2500) → 0.0
tax(7500) → 450.0
tax(25000) → 3900.0

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

public double tax(double income) { }

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