Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Output each floating-point value with two digits after the decimal point, which can be achieved as follows print (:.20).format(your_value)) (1) Prompt the user for the

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Output each floating-point value with two digits after the decimal point, which can be achieved as follows print (:.20).format(your_value)) (1) Prompt the user for the number of cups of lemon juice, water, and agave neotar needed to make lemonade. Prompt the user to specify the number of servings the recipe yields Output the ingredients and serving size (Submit for 2 points) Note This zylab outputs a newline after each user-input prompt For convenience in the examples below the user's input value is shown on the next line, but such values don't actually appear as output when the program runs. Note this ZyLab outpuis a new arter each user-input prompt. For ce in the the next line, but such values don't actually appear as output when the program runs. Enter amount of lemon juice (in cups): 2 Enter amount of water (in cups): 16 Enter amount of agave nectar (in cups): 2.5 How many servings does this make? 6 Lemonade ingredients yields 6.00 servings 2.00 cup(s) lemon juice 16.00 cup (s) water 2.50 cup (s) agave nectar (2) Prompt the user to specify the desired number of servings. Adjust the amounts of e ingredients and serving size. (Submit for 4 points, so 6 points total). How many servings would you like to make? (2) Prompt the user to specify the desired number of servings. Adjust the amounts of each ingredient accordingly, and then output the ingredients and serving size (Submit for 4 points so 6 points total) How many servings would you like to make? 48 Lemonade ingredients - yields 48.00 servings 16.00 cup(s) lemon juice 128.00 cup(s) water 20.00 cup(s) agave nectar (3) Convert the ingredient measurements from (2) to gallons Output the ingredients and serving size. Note: There are 16 cups in a gallon (Submit for 2 points, so 8 points total) Lemonade ingredients yields 48.00 servings 1.00 gallon (s) lemon juice 8.00 gallon(s) water 1.25 gallon(s) agave nectar LAD ACTIVITY 2.22.1: LAB". Program: Cooking measurement converter 2/8 main.py Lood default template 1 FIXE (1) Finish reading other items into variables, then output the three ingedients 3 lemon juice - Int(input("Enter anunt of lemon juice (in cups): ")) 4 water int (input("Enter amount of water (in cups); 5 agave_nectar - float(input("Enter amount of agave nectar in cups")) 6 serving - int (input("How many serving does this maken") 2 print(" Lenonade ingredients - yields (1.2) Serving for at serving) print(1.2) cup(s) lemon juice.format(lemon juice) 1e print (2) cup() water. Forst (water)) 11 mint(2) Cup(s) agove nectar formatave nectarin)) 12 13 14 FIXE (2) Prompt user for desired number of servings Convert and output the ingredients 15 16 servinenerint input (How many servings would you like to make 17 serving factor serving new serving 1 lemon juice_new.lemon juice serving_factor 19 water new - water servine Factor 20 gave_nectac_new-agave_nectar serving factor + Develop modo Submit mode When done developing your program press the Submit for grading button below. This will submit your program for grading and count against any submission imuts your instructor has set main.py 19 water new - water * serving factor 20 agave_nectar_new = agave_nectar serving_factor 21 22 23 print(" Lemonade ingredients yields {: .2f} servings".format(serving new)) 24 print('{:.2f} cup(s) lemon juice'.format(lemon_juice_new)) 25 print('{: .2f} cup(s) water'.format(water_new)) 26 print('{:.2f} cup(s) agave nectar'.format(agave_nectar_new)) 27 28 # FIXME (3): Convert and output the ingredients from (2) to gallons 29 30 gallon_factor = 1 / 16 31 lemon juice_new lemon_juice gallon_factor 32 water_new = water gallon_factor 33 agave_nectar_new = agave_nectar * gallon_factor 34 35 print(" Lemonade ingredients yields {: .2f} servings".Format(serving_new)) 36 print('{:.2f} gallon(s) lemon juice'.format(lemon juice_new)) 37 print('{:.2f} gallon(s) water', format (water_new)) 38 print("{: .2f} gallon(s) agave nectar..format(agave_nectar_new)) 4 Develop mode Submit mode When done developing your program press the submit your program for grading and count aga set Latest submission - 8:41 PM on 02/25/21 Total score: 2/8 Only show failing tests Download this submission 1. Compare output 2/2 Input 2 16 2.5 6 48 Enter amount of lemon juice (in cups): Enter amount of water (in cups): Enter amount of agave nectar (in cups): How many servings does this make ? Your output correctly starts with Lemonade ingredients - yields 6.00 servings 2.00 cup(s) lemon juice 16.00 cups water 2.50 cup (a) agave nectar 2. Compare output Output differs. See highlights below. Special character legend 2 16 Input 2.5 6 48 Enter amount of lemon juice (in cups) : Enter amount of water (in cups): Enter amount of agave nectar (in cups): How many servings does this make 2 Your output starts with Lemonade ingredients yields 6.00 servings 2.00 cup(s) lemon juice 16.00 cups) water 2.510 eup (s) agavel nectar How many servings would you like to make ? Lemonade redients yields 1800 servings 16.00 und lemon juice 12800 Ks WALE Your output starts with Lemonade ingredients yields 6.00 servings 2.00 cup (s) lemon juice 16.00 cup (s) water 2.50 cup(s) agave nectar How many servings would you like to make? Lemonade ingredients - yields 48.00 servings 16.00 cup (s) lemon juice 128.00 cup (s) water 20.00 cup (s) agave nectar Enter amount of lemon juice (in cups) : Enter amount of water (in cups): Enter amount of agave nectar (in cups) : How many servings does this make? Lemonade ingredients yields 6.00 servings 2.00 cup(s) lemon juice 16.00 cup (s) water 2.50 cup (s) agave nectar Expected output starts with How many servings would you like to make Ke Lemonade ingredients yields 6.00 servings 2.00 cup(s) lemon juice 16.00 cup (s) water 2.50 cup (s) agave nectar Expected output starts with How many servings would you like to make? Lemonade ingredients yields 48.00 servings 16.00 cup(s) lemon juice 128.00 cup (s) vate 20.00 cup (s) agave nectar 3. Compare output Output differs See highlights below. Special character legend 2 16 2.5 Input 6 1 3 Enter amount of lemon juice (in cups): Enter amount of water (in cups): Enter amount of agave nectar (in cups): How many servings does this make? Your output starts with Lemonade ingredients yields 6.00 servings 2.00 cup(s) lemon juice 16.00 cup (s) water 2.50 cup(s) agave nectar How many servings would you like to make? Lemonade ingredients yields 3.00 servings 1.00 cup (s) lemon juice 8.00 cup (s) water 1.25 cup (s) agave nectar Enter amount of lemon juice (in cups): Enter amount of water (in cups): Enter amount of agave nectar in cups): How many serumos does make ? LES Temon juice 8.00 cup (s) water 1.25 cup (s) agave nectar Enter amount of lemon juice (in cups) : Enter amount of water (in cups): Enter amount of agave nectar (in cups): How many servings does this make? Lemonade ingredients yields 6.00 servings 2.00 cup (s) lemon juice 16.00 cup (s) water 2.50 cup(s) agave nectar Expected output starts with How many servings would you like to make ? Lemonade ingredients yields 3.00 servings 1.00 cup (s) lemon juice 8.00 cup(s) water 1.25 cup (s) agave nectar 4. Compare output 1.25 cup(s) agave nectar 4. Compare output 072 Output differs. See highlights below. Special character depend Input 2 16 2.5 6 49 Enter amount of lemon juice (in cups) : Enter amount of water (in cups): Enter amount of agave nactar (in cups): How many servings does this maka? Lemonade ingredients - yields 6.00 servings 2.00 cup(s) lemon juice 16.00 cup (a) water 2.50 cup(s) agave nectar How many servings would you like to make? Your output Lemonade ingredients yields 49.00 servings 16.00 cups) lemon juice Lemonade ingredients yields 6.00 servings 2.00 cup (s) lemon juice 16.00 cup (s) water 2.50 cup(s) agave nectar How many servings would you like to make? Your output Lemonade ingredients yields 48.00 servings 16.00 cup (s) lemon juice 128.00 cup (s) water 20.00 cup (s) agave nectar Lemonade ingredients yields 48.00 servings 0.12 gallon(s) lemon juice 1.00 gallon (s) water 0.16 gallon(s) agave nectar Enter amount of lemon juice (in cups): Enter amount of water (in cups) Enter amount of agave nectar din cups) How many servings does this make? Lemonade ingredients yields 6.00 servings 2.00 cup (s) lemon juice 16000 cups water 2.50 cup is agave nectar encen amount on agave nectar an cups How many servings does this make? Lemonade ingredients yields 6.00 servings 2.00 cup(s) lemon juice 16.00 cup(s) water 2.50 cup (s) agave nectar Expected output How many servings would you like to make? Lemonade ingredients yields 48.00 servings 16.00 cup (s) lemon juice 128.00 cup (s) water 20.00 cup (s) agave nectar Lemonade ingredients yields 48.00 servings 1.00 gallon (s) lemon juice 8.00 gallon (s) water 1.25 gallon (s) agave nectar

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_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

The World Wide Web And Databases International Workshop Webdb 98 Valencia Spain March 27 28 1998 Selected Papers Lncs 1590

Authors: Paolo Atzeni ,Alberto Mendelzon ,Giansalvatore Mecca

1st Edition

3540658904, 978-3540658900

More Books

Students also viewed these Databases questions

Question

5. Describe how contexts affect listening

Answered: 1 week ago