# frozen_string_literal: true module TaxCalculator module Ohio def self.taxes_for(income) from_brackets(income).round(2) end private # 2020 def self.from_brackets(income) if income <= 25_000 0 elsif income <= 44_250 (income - 25_000) * 0.02765 + 346.16 elsif income <= 88_450 (income - 44_250) * 0.03226 + 878.42 elsif income <= 110_650 (income - 88_450) * 0.03688 + 2304.31 elsif income > 110_650 (income - 110_650) * 0.03990 + 3123.05 end end end end