Giter Site home page Giter Site logo

nirajam / tax-calculator Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 15 KB

This assessment consists in writing a simple application that prints out the details of a receipt containing items purchased by a customer. The receipt should list the number of items, the name, the final price (including taxes) of each of the item purchased, plus two extra lines showing the total amount of the receipt and the total amount of taxes.

Java 100.00%

tax-calculator's Introduction

Problem statement This assessment consists in writing a simple application that prints out the details of a receipt containing items purchased by a customer. The receipt should list the number of items, the name, the final price (including taxes) of each of the item purchased, plus two extra lines showing the total amount of the receipt and the total amount of taxes.

Taxes are calculated with a rate of 17.5%, rounding the tax result to the upper 0.05. Please note that medical products are exempt and an additional 1.25 fixed amount is added as an extra tax on CDs

Input JSON:

[ { "name": "book", "type": "OTHERS", "quantity": 1, "price": 29.49 }, { "name": "music", "type": "CD", "quantity": 1, "price": 15.99 }, { "name": "chocolate snack", "type": "OTHERS", "quantity": 1, "price": 0.75 } ]

Output JSON:

{ "purchases": [ { "item": { "name": "book", "type": "OTHERS", "quantity": 1, "price": 29.49 }, "taxes": 5.2, "total": 34.7 }, { "item": { "name": "music", "type": "CD", "quantity": 1, "price": 15.99 }, "taxes": 4.05, "total": 20.05 }, { "item": { "name": "chocolate snack", "type": "OTHERS", "quantity": 1, "price": 0.75 }, "taxes": 0.15, "total": 0.9 } ], "taxes": 9.35, "total": 55.6 }

tax-calculator's People

Contributors

nirajam avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.