Skip to content

Latest commit

 

History

History
31 lines (20 loc) · 929 Bytes

README.md

File metadata and controls

31 lines (20 loc) · 929 Bytes

Basic sales tax is applicable at a rate of 10% on all goods, except books, food, and medical products that are exempt. Import duty is an additional sales tax applicable on all imported goods at a rate of 5%, with no exemptions.

When I purchase items I receive a receipt which lists the name of all the items and their price (including tax), finishing with the total cost of the items, and the total amounts of sales taxes paid. The rounding rules for sales tax are that for a tax rate of n%, a shelf price of p contains (np/100 rounded up to the nearest 0.05) amount of sales tax.

Run

To run the scenarios from the termial run any of the following inputs.

# Input 1
ruby main.rb ./utils/list_1.txt

# Input 2
ruby main.rb ./utils/list_2.txt

# Input 3
ruby main.rb ./utils/list_3.txt

Testing

Tests are run in RSpec

#from the root of the application.
rspec

  • Version: 1.0.0
  • Author: Binyamin David