Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Programming Practice 2.3: Ingredient Adjuster 15 pts Not Submitted Due Feb 2, 2020 at 11:59 PM Submission Types File Upload File Types Submission & Rubric

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Programming Practice 2.3: Ingredient Adjuster 15 pts Not Submitted Due Feb 2, 2020 at 11:59 PM Submission Types File Upload File Types Submission & Rubric Description Lesson Objective(s): Practice with input and output Perform calculations Format numeric output Lesson: A cookie recipe calls for the following ingredients: 1.5 cups of sugar 1 cup of butter 2.75 cups of flour The recipe produces 48 cookies with this amount of ingredients. Write a program that asks the user how many cookies they want to make, and then displays the number of cups (to two decimal places) of each ingredient needed for the specified number of cookies. Hints: Variable names in PyCharm should be separated by an underscore when there are two or more words: variable_name All input is read into Python as strings. You will need to convert the strings to numbers in some cases. To convert a string to an integer and save it to a variable: cookie_num = int(input('How many cookies do you want to make? ')) You would do the same type of process for a float: butter_amt = float(input('How much butter do you have')) Remember an integer is a whole number and a float has values to the right of the decimal point. Assignment Requirements: Use comments to describe the problem listed above remembering to format your numbers. Hand in the .py file. Sample Results for 100 cookies: How many cookies do you want to make? 100 To make 100.cookies, you will need: 1.3.12 cups of sugar. .2.08 cups of butter. 1.5.73 cups of flour

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions