This Ruby code simmulates a basic order transaction at a grocery store.
St. Bernard Corner store sells products in 3 different counties, the taxes in Miami-Dade county is 6%, in Broward is 7% and in palm beach is 8%.
The Product is described by the brand name, product name and the cost price. St. Bernard marks up the product price by 25% in Miami-Dade county, and 30% each in palm beach and Broward county. If they sold 100 of one product in each of the 3 counties, what is their total profit if the cost price of the product is $30. Implement using object-oriented design and principles.
Install Ruby, and bundler if you don't have it already, as follows: gem install bundle.
git clone git://github.com/developertogo/convenience-store.git
cd convenience-store
bundle install
ruby convenience_store.rb
Simply run:
$ rspec