{"id":20721672,"url":"https://github.com/chicio/sales-taxes","last_synced_at":"2026-07-10T12:31:33.453Z","repository":{"id":50744796,"uuid":"73508252","full_name":"chicio/Sales-Taxes","owner":"chicio","description":":dollar: :credit_card: An iOS implementation of the Sales Taxes technical interview problem.","archived":false,"fork":false,"pushed_at":"2021-12-28T08:41:28.000Z","size":2671,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-08T07:28:30.489Z","etag":null,"topics":["agile","coding-dojo","kata"],"latest_commit_sha":null,"homepage":"http://fabrizioduroni.it/blog/","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chicio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-11-11T20:13:32.000Z","updated_at":"2023-08-19T08:29:38.000Z","dependencies_parsed_at":"2022-09-10T18:02:04.989Z","dependency_job_id":null,"html_url":"https://github.com/chicio/Sales-Taxes","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chicio/Sales-Taxes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chicio%2FSales-Taxes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chicio%2FSales-Taxes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chicio%2FSales-Taxes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chicio%2FSales-Taxes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chicio","download_url":"https://codeload.github.com/chicio/Sales-Taxes/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chicio%2FSales-Taxes/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35331951,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-10T02:00:06.465Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agile","coding-dojo","kata"],"created_at":"2024-11-17T03:28:57.668Z","updated_at":"2026-07-10T12:31:33.437Z","avatar_url":"https://github.com/chicio.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sales-Taxes\n\n[![Build Status](https://travis-ci.org/chicio/Sales-Taxes.svg?branch=master)](https://travis-ci.org/chicio/Sales-Taxes)\n[![codecov](https://codecov.io/gh/chicio/Sales-Taxes/branch/master/graph/badge.svg)](https://codecov.io/gh/chicio/Sales-Taxes)\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/chicio/Sales-Taxes/blob/master/LICENSE.md)\n[![Supported platform](https://img.shields.io/badge/platform-iOS-orange.svg)](https://img.shields.io/badge/platform-iOS-orange.svg)\n\nAn iOS implementation of the Sales Taxes technical interview problem.\n\n***\n### Introduction\nThis is the text of the problem:\n\u003eBasic 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.\n\u003e \u0026nbsp;\n\u003e 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. \u003cbr/\u003e\n\u003eWrite an application that prints out the receipt details for these shopping baskets...\n\u003e\n\u003eINPUT\n\u003e\n\u003e\u003cul\u003eInput 1:\n\u003e \u003cli\u003e1 book at 12.49 \u003c/li\u003e\n\u003e \u003cli\u003e1 music CD at 14.99\u003c/li\u003e\n\u003e \u003cli\u003e1 chocolate bar at 0.85\u003c/li\u003e\n\u003e \u003c/ul\u003e\n\u003e \n\u003e\u003cul\u003eInput 2:\n\u003e \u003cli\u003e1 imported box of chocolates at 10.00\u003c/li\u003e\n\u003e \u003cli\u003e1 imported bottle of perfume at 47.50\u003c/li\u003e\n\u003e\u003c/ul\u003e\n\u003e\n\u003e\u003cul\u003eInput 3:\n\u003e \u003cli\u003e1 imported bottle of perfume at 27.99\u003c/li\u003e\n\u003e \u003cli\u003e1 bottle of perfume at 18.99\u003c/li\u003e\n\u003e \u003cli\u003e1 packet of headache pills at 9.75\u003c/li\u003e\n\u003e \u003cli\u003e1 box of imported chocolates at 11.25\u003c/li\u003e\n\u003e\u003c/ul\u003e\n\u003e \u003cbr/\u003e\nOUTPUT\n\u003e\n\u003e\u003cul\u003eOutput 1:\n\u003e \u003cli\u003e1 book : 12.49\u003c/li\u003e\n\u003e \u003cli\u003e1 music CD: 16.49\u003c/li\u003e\n\u003e \u003cli\u003e1 chocolate bar: 0.85\u003c/li\u003e\n\u003e \u003cli\u003eSales Taxes: 1.50\u003c/li\u003e\n\u003e \u003cli\u003eTotal: 29.83\u003c/li\u003e\n\u003e\u003c/ul\u003e\n\u003e\n\u003e\u003cul\u003eOutput 2:\n\u003e \u003cli\u003e1 imported box of chocolates: 10.50\u003c/li\u003e\n\u003e \u003cli\u003e1 imported bottle of perfume: 54.65\u003c/li\u003e\n\u003e \u003cli\u003eSales Taxes: 7.65\u003c/li\u003e\n\u003e \u003cli\u003eTotal: 65.15\u003c/li\u003e\n\u003e\u003c/ul\u003e\n\u003e\n\u003e\u003cul\u003eOutput 3:\n\u003e \u003cli\u003e1 imported bottle of perfume: 32.19\u003c/li\u003e\n\u003e \u003cli\u003e1 bottle of perfume: 20.89\u003c/li\u003e\n\u003e \u003cli\u003e1 packet of headache pills: 9.75\u003c/li\u003e\n\u003e \u003cli\u003e1 imported box of chocolates: 11.85\u003c/li\u003e\n\u003e \u003cli\u003eSales Taxes: 6.70\u003c/li\u003e\n\u003e \u003cli\u003eTotal: 74.68\u003c/li\u003e\n\u003e\u003cul\u003e\n\n***\n### Overview\n\nI created two versions of the same iOS app: the first written using Objective-C, the second one written using Swift. The app is a prototype with a simple UI that could be used to test visually that the apps meet the requirments of the problem (see animation below).The three input data set contained in the problem text are also contained in a test suit (SalesTaxesTests.m) that could be used to verify the correctness of the code.\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/chicio/Sales-Taxes/blob/master/Screenshots/app-ui.gif\"/\u003e\n\u003c/p\u003e\n\n***\n### Tools\nI used \u003ca href=\"https://travis-ci.org\"\u003eTravis-CI\u003c/a\u003e as Continuous Integration service.\nI used OCMock as Mocking framework for the test implementation (only Objective-C version).\nI used \u003ca href=\"https://codecov.io/gh\"\u003ecodecov\u003c/a\u003e as Code Coverage service (only Objective-C version).\nCode coverage has also been activated in XCode scheme. In this way it is possible to see code coverage live inside the IDE (see screenshot below).\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/chicio/Sales-Taxes/blob/master/Screenshots/xcode-code-coverage.png\"/\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/chicio/Sales-Taxes/blob/master/Screenshots/xcode-code-coverage-2.png\"/\u003e\n\u003c/p\u003e\n\nAll code has been commented using XCode documentation syntax. It is possible to access to the documentation of a class or method using the shorcut Alt + Left Mouse Click on any name (see screenshot below).\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/chicio/Sales-Taxes/blob/master/Screenshots/xcode-comments.png\"/\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchicio%2Fsales-taxes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchicio%2Fsales-taxes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchicio%2Fsales-taxes/lists"}