Giter Club home page Giter Club logo

salestax's Introduction

Illinois Sales Tax Calculator

The price of goods and services changes base on where you purchase it. The cost of living is artificial/relative. Your goal is to create a little calculator widget that will compute the total cost depending on where you buy your good/service and the amount of course.

This tax link has the information on various cities shipping tax rates. Here is a short list of useful statistics from the website.

  • Illinois Tax Rate: 6.25%
  • Minimum Shipping Rate: 7.50%
  • Maximum Shipping Rate: 10.25%

Total cost

It should be noted that the total cost of the item is found by taking the price of the item and multiplying by the sales tax. If there is shipping, which we will assume happens in all cases, then you need to add the cost of shipping and handling multiplied by the shipping tax from its location.

Shipping

Your shipping should be a function of two variables: the type and the location. You should use the radio input type for the type of shipping variable and a text input for location.

  • type of shipping: standard = $2.99; priority = $4.99; express = $8.99
  • location: choose the name of the city.

Your Program Goals

  • Make sure your widget has the correct number of input and types of input fields to grab the necessary data.
  • In the javascript, use query selectors to store the information in variables
  • Do some math with the variables to calculate the total cost
  • display the answer to your selection in the span element.

Extra Challenge

If you get the price to display, enable a new feature which will also predict the expected date of delivery. This willl be based off of the shippingtype variable that you used in the previous example.

  • standard shipping will be delivered 5 days later
  • priority shipping will be delivered 3 days later
  • express shipping will be delivered 2 days later

To compelte this challenge you will need to add a new span element underneath the answer span. Follow the same process of selecting information and conditionally setting variables and updating html elements to produce the desired effect. It would probably be easiest to make additions to your code than invent a whole new function.

You will need to use the JavaScript Date Object to complete this easily. The most mathematics you will need is adding and multiplication. Read the code examples below how to get, set and update Dates!

salestax's People

Contributors

shamrockprogramming avatar

Watchers

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