# RecipeChallenge

Created: 2014-05-18 19:54
Updated: 2014-10-10 18:50

Recipe Calculator

The intent of this assignment is to evaluate your design, development, and testing skills. Please approach it as if you were assigned it as part of your daily work. To complete it, you will need to provide a working application with tests written in any language you want. It's up to you to implement any mechanism you wish to feed data into the application and to display its results. You're given a list of ingredients and recipes and asked to write an application that computes the following for each recipe:  Sales Tax (8.6% of the total price rounded up to the nearest 7 cents, applies to everything except produce)  Wellness Discount (-5% of the total price rounded up to the nearest cent, applies only to organic items)  Total Cost (should include the sales tax and the discount)

Input

Ingredients Produce  1 clove of organic garlic = \$0.67  1 Lemon = \$2.03  1 cup of corn = \$0.87 Meat/poultry  1 chicken breast = \$2.19  1 slice of bacon = \$0.24 Pantry  1 ounce of pasta = \$0.31  1 cup of organic olive oil = \$1.92  1 cup of vinegar = \$1.26  1 teaspoon of salt = \$0.16  1 teaspoon of pepper = \$0.17

Recipes

Recipe 1  1 garlic clove  1 lemon  3/4 cup olive oil  3/4 teaspoons of salt  1/2 teaspoons of pepper Recipe 2  1 garlic clove  4 chicken breasts  1/2 cup olive oil  1/2 cup vinegar Recipe 3  1 garlic clove  4 cups of corn  4 slices of bacon  8 ounces of pasta  1/3 cup olive oil  1 1/4 teaspoons of salt  3/4 teaspoons of pepper

Output

Recipe 1 Tax = \$0.21 Discount = (\$0.11) Total = \$4.45 Recipe 2 Tax = \$0.91 Discount = (\$0.09) Total = \$11.84 Recipe 3 Tax = \$0.42 Discount = (\$0.07) Total = \$8.91

Cookies help us deliver our services. By using our services, you agree to our use of cookies Learn more