114k views
3 votes
(1) Prompt the user for the number of cups of lemon juice, water, and agave nectar 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).

1 Answer

5 votes

Answer:

The program to this question as follows:

Program:

Lemon= float(input('Enter lemon juice value in cups: ')) #defining float variable and input value by user

Water= float(input('Enter water value in cups: ')) #defining float variable and input value by user

Agave= float(input('Enter agave nectar value in cups: ')) #defining float variable and input value by user

Serve= float(input('enter serving value: ')) #defining float variable and input value by user

print ('Lemonade ingredients - yields',Serve,'servings',) #print value

print (Lemon,'cups in lemon juice',) #print value

print (Water,'cups in water',) #print value

print (Agave,'cups in agave nectar',) #print value

Output:

Enter lemon juice value in cups: 2

Enter water value in cups: 3

Enter agave nectar value in cups: 2

enter serving value: 2

Lemonade ingredients - yields 2.0 servings

2.0 cups in lemon juice

3.0 cups in water

2.0 cups in agave nectar

Step-by-step explanation:

In the above python code, four float variable "Lemon, Water, Agave, and Serve" is defined, which is the input function is used.

  • The input function message is written that passes in function parameter, that accepts value in the above variables.
  • In the next step, the print function is used, which prints the above user input values.
User Eike Pierstorff
by
5.8k points