GithubHelp home page GithubHelp logo

car-price-caculator's Introduction

If you want to buy a car in philippines, you’ll notice the difference of price as below

  1. two cars, for example Jeep Grand Cherokee 6.4L and BMW M2 3.0L, the tax is different, 6.4L car will have higher tax rate
  2. Two cars, same capacity in ccm like 3.0L, the cars imported from USA and Japan is comparatively cheaper than the car from Europe If we have a table about import tax rate of as below:

Country <=2.0L >2.0L & <= 5.0L >5.0L

Europe 100% 120% 200%

USA 75% 90% 150%

Japan 70% 80% 135%

Also if you want to buy anything in philippines, you need to pay VAT 12% Now please write an program to calculate the price end user should pay, we assume the formula is

(end-user price) = (original price) + (import tax) + VAT (import tax) = (original price ) * (import tax rate) VAT = ((original price) + (import tax)) * 12%

Now we have 4 cars:

  1. Benz G65 from Germany (Europe county), 6.0L, original price $217,900USD
  2. Honda Jazz 1.5L (Japan) original price $19,490 USD
  3. Jeep wrangler 3.6L (USA) original price, $36,995USD
  4. Chery QQ 1.0L (China) original price, $6,000USD

If we use the exchange rate 1 USD=47 Pesos. Please write down you program to calculate the car end-user price in Philippine Pesos, and write down your unit test.

Requirement:

  1. with unit test
  2. No duplication
  3. No if-else, switch

car-price-caculator's People

Contributors

jacy avatar

Watchers

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