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 customize a recipe size and
view nutritional information. A simple shortbread cookie recipe uses C butter, C sugar, and
C flour to make 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 cookies of which they will eat User input is circled to differentiate it from output:
A recipe of cookies and eating will produce the following output:
Use the following data in your calculations:
Standard Shortbread Recipe Cookies
Butter Cup
Sugar Cup
Flour Cups
Nutritional Data Cookie
Calories
Carbs g
Fat g
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 and then multiply those results by the users desired number of cookies. The nutritional
data are already given per 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
