{"id":15355892,"url":"https://github.com/fibo/solve-this-simple-exercise","last_synced_at":"2025-09-11T12:43:19.723Z","repository":{"id":21609833,"uuid":"24930132","full_name":"fibo/solve-this-simple-exercise","owner":"fibo","description":"solve this simple exercise, you can choose whatever programming language you prefer","archived":false,"fork":false,"pushed_at":"2014-10-08T10:52:18.000Z","size":132,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-02T21:43:55.474Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fibo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-10-08T07:52:00.000Z","updated_at":"2014-10-08T10:52:18.000Z","dependencies_parsed_at":"2022-08-05T13:18:11.990Z","dependency_job_id":null,"html_url":"https://github.com/fibo/solve-this-simple-exercise","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fibo%2Fsolve-this-simple-exercise","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fibo%2Fsolve-this-simple-exercise/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fibo%2Fsolve-this-simple-exercise/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fibo%2Fsolve-this-simple-exercise/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fibo","download_url":"https://codeload.github.com/fibo/solve-this-simple-exercise/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240136983,"owners_count":19753645,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-10-01T12:26:08.231Z","updated_at":"2025-02-22T06:43:53.218Z","avatar_url":"https://github.com/fibo.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"solve-this-simple-exercise\n==========================\n\n\u003e solve this simple exercise, you can choose whatever programming language you prefer\n\nThis problem requires some kind of input. You are free to implement any \nmechanism for feeding input into your solution (for example, using hard coded \ndata within a unit test). You should provide sufficient evidence that your \nsolution is complete by, as a minimum, indicating that it works correctly \nagainst the supplied test data.\n\nBasic sales tax is applicable at a rate of 10% on all goods, except books, \nfood, and medical products that are exempt. Import duty is an additional sales \ntax applicable on all imported goods at a rate of 5%, with no exemptions.\n\nWhen I purchase items I receive a receipt which lists the name of all the \nitems and their price (including tax), finishing with the total cost of the \nitems, and the total amounts of sales taxes paid. The rounding rules for sales \ntax are that for a tax rate of n%, a shelf price of p contains (np/100 rounded \nup to the nearest 0.05) amount of sales tax.\n\nWrite an application that prints out the receipt details for these shopping \nbaskets.\n\n## INPUT\n\n### Input 1\n\n```\n1 book at 12.49\n1 music CD at 14.99\n1 chocolate bar at 0.85\n```\n\n### Input 2\n\n```\n1 imported box of chocolates at 10.00\n1 imported bottle of perfume at 47.50\n```\n\n### Input 3\n\n```\n1 imported bottle of perfume at 27.99\n1 bottle of perfume at 18.99\n1 packet of headache pills at 9.75\n1 box of imported chocolates at 11.25\n```\n\n## OUTPUT\n\n### Output 1\n\n```\n1 book : 12.49\n1 music CD: 16.49\n1 chocolate bar: 0.85\nSales Taxes: 1.50\nTotal: 29.83\n```\n\n### Output 2\n\n```\n1 imported box of chocolates: 10.50\n1 imported bottle of perfume: 54.65\nSales Taxes: 7.65\nTotal: 65.15\n```\n\n### Output 3\n\n```\n1 imported bottle of perfume: 32.19\n1 bottle of perfume: 20.89\n1 packet of headache pills: 9.75\n1 imported box of chocolates: 11.85\nSales Taxes: 6.70\nTotal: 74.68\n```\n\n## Solution\n\nScript *solution.pl* is written in [Perl](http://www.perl.org).\n\nLaunch it to produce output as required.\n\n```bash\nperl solution.pl input1.txt\nperl solution.pl input2.txt\nperl solution.pl input3.txt\n```\n\nYou can try it in [this codio box](https://codio.com/fibo/solve-this-simple-exercise).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffibo%2Fsolve-this-simple-exercise","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffibo%2Fsolve-this-simple-exercise","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffibo%2Fsolve-this-simple-exercise/lists"}