Working code implemented in Python and appropriate
comments provided for better understanding:
Source code for main.py:
lemon=float(input('Enter amount of lemon juice (in cups):
\n'))
water=float(input('Enter amount of water (in cups): \n'))
agave=float(input('Enter amount of agave nectar (in cups):
\n'))
jug=float(input('How many servings does this make? \n'))
print ('\nLemonade ingredients - yields',jug,'servings')
print (lemon,'cup(s) lemon juice')
print (water,'cup(s) water')
print (agave,'cup(s) agave nectar')
serv=float(input('\nHow many servings would you like to make?
\n'))
lemon = ((lemon/6)*serv)
water = ((water/6)*serv)
agave = ((agave/6)*serv)
print ('\nLemonade ingredients - yields',serv,'servings')
print (lemon,'cup(s) lemon juice')
print (water,'cup(s) water')
print (agave,'cup(s) agave nectar')
print ('\nLemonade ingredients - yields',serv,'servings')
print (lemon/16,'gallon(s) lemon juice')
print (water/16,'gallon(s) water')
print (agave/16,'gallon(s) agave nectar')
Code Screenshots:
Output Screenshots:
Hope it helps, if you like the answer give it a thumbs
up. Thank you.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 lemon=float(input('Enter amount of lemon juice (in cups): \n')) water-float(input('Enter amount of water (in cups): \n')) agave-float(input('Enter amount of agave nectar (in cups): \n')) jug=float(input('How many servings does this make? \n')) print ("\nLemonade ingredients - yields', jug, 'servings') print (lemon,'cup(s) lemon juice') print (water, 'cup(s) water') print (agave,'cup(s) agave nectar') serv-float(input('\nHow many servings would you like to make? \n')) lemon ((lemon/6) serv) water ((water/6) serv) agave ((agave/6) serv) print ("\nLemonade ingredients - yields', serv, 'servings) print (lemon, 'cup(s) lemon juice') print (water, 'cup(s) water') print (agave,'cup(s) agave nectar') print ('\nLemonade ingredients - yields', serv, 'servings") print (lemon/16, 'gallon(s) lemon juice') print (water/16, 'gallon(s) water') print (agave/16, 'gallon(s) agave nectar')| 16 17 18 19 20 21 22 23 24
x 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.0 servings 2.0 cup (s) lemon juice 16.0 cup(s) water 2.5 cup(s) agave nectar How many servings would you like to make? 48 Lemonade ingredients - yields 48.0 servings 16.0 cup (s) lemon juice 128.0 cup (s) water 20.0 cup(s) agave nectar Lemonade ingredients - yields 48.0 servings 1.0 gallon (s) lemon juice 8.0 gallon(s) water 1.25 gallon(s) agave nectar