Coder Social home page Coder Social logo

sales_tax's Introduction

Sales Taxes DEALERON Coding Test

My code takes in 3 requirements from the user; the product they want, the quantity of the product that they want, and whether or not it will need to be imported from somewhere.

The user can enter any number of items they want at any quantity and once the user is finished adding items a receipt is printed out showing the items selected, the tax, and the total cost for the items.

My Thought Process

Originally I was going to allow the user to enter in a single sentence and have a function search through the sentence and pick out the quantity, the product, and whether or not it needed to be imported.

But after some testing it seemed easier for me as a programmer and for the user, in their decision making, to break these three things up into smaller pieces.

Also when thinking about it from a database perspective if this were in a database these options would probably be pieced out anyways into smaller options rather then clumped together.

The requirements for the project were as follows:

There are a variety of items for sale at a store. When a customer purchases items, they receive a receipt. The receipt lists all of the items purchased, the sales price of each item (with taxes included), the total sales taxes for all items, and the total sales price.

Basic sales tax applies to all items at a rate of 10% of the item’s list price, with the exception of books, food, and medical products, which are exempt from basic sales tax. An import duty (import tax) applies to all imported items at a rate of 5% of the shelf price, with no exceptions.

Write an application that takes input for shopping baskets and returns receipts in the format shown below, calculating all taxes and totals correctly. When calculating prices plus tax, round the total up to the nearest 5 cents. For example, if a taxable item costs $5.60, an exact 10% tax would be $0.56, and the final price after adding the rounded tax of $0.60 should be $6.20.

sales_tax's People

Watchers

James Cloos avatar Nick Boober 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.