Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/simars/markup-calculator-ruby
Markup Calculator Implementation in Ruby
https://github.com/simars/markup-calculator-ruby
Last synced: about 1 month ago
JSON representation
Markup Calculator Implementation in Ruby
- Host: GitHub
- URL: https://github.com/simars/markup-calculator-ruby
- Owner: simars
- Created: 2014-04-02T23:11:41.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-04-04T16:38:23.000Z (almost 11 years ago)
- Last Synced: 2023-08-19T00:21:45.708Z (over 1 year ago)
- Language: Ruby
- Size: 125 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Dependencies: Libraries
==============================
* ruby-1.9.3
* RSpec
* : rspec-core-2.14.8.gem (100%)
* : diff-lcs-1.2.5.gem (100%)
* : rspec-expectations-2.14.5.gem (100%)
* : rspec-mocks-2.14.6.gem (100%)
* : rspec-2.14.1.gem (100%)Solution: Pricing problem
==============================NuPack is responsible for taking existing products and repackaging them for sale at electronic stores like Future Shop and Best Buy. Companies will phone up NuPack, explain the process and NuPack needs to quickly give them an estimate of how much it will cost. Different markups to the job:
* Without exception, there is a flat markup on all jobs of 5%
* For each person that needs to work on the job, there is a markup of 1.2%Markups are also added depending on the types of materials involved:
* If pharmaceuticals are involved, there is an immediate 7.5% markup
* For food, there is a 13% markup
* Electronics require a 2% markup
* Everything else, there is no markupAnother system calculates the base price depending on how many products need to be repackaged. As such, the markup calculator should accept the initial base price along with the different categories of markups and calculate a final cost for a project.
The flat markup is calculated first and then all other markups are calculated on top of the base price plus flat markup.
For example...
Input 1:
--------
$1299.99
3 people
foodInput 2:
--------
$5432.00
1 person
drugsInput 3:
--------
$12456.95
4 people
booksOutput 1: $1591.58
Output 2: $6199.81
Output 3: $13707.63