Question: Code a Python Shortbread Calculator that will allow a user to 1 ) customize a recipe size and 2 ) view nutritional information. A simple

Code a Python Shortbread Calculator that will allow a user to 1) customize a recipe size and 2)
view nutritional information. A simple shortbread cookie recipe uses 1C butter, (1)/(2)C sugar, and
2C flour to make 16 cookies. Your calculator will display custom ingredient amounts for any
number of cookies the user enters. For example, the following user is wanting to make a half recipe
of 8 cookies (of which they will eat 4). User input is circled to differentiate it from output:
A recipe of 4 cookies (and eating 2) will produce the following output:
Use the following data in your calculations:
Standard Shortbread Recipe 16 Cookies
Butter 1 Cup
Sugar (1)/(2) Cup
Flour 2 Cups
Nutritional Data 1 Cookie
Calories 160
Carbs 18g
Fat 12g
You may approach this any way you like, but one way would be to begin your program by
calculating the ingredient portions for ONE cookie (by dividing each of the original recipe portions
by 16), and then multiply those results by the users desired number of cookies. The nutritional
data are already given per 1 cookie, so that will be just straight multiplication.
Since decimal lengths will vary depending on recipe sizes, Ill advise you not to fiddle with
decimal formatting at all this program. Well have plenty of opportunities to use that technique
later.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!