Question: Define a function that takes two parameters: cups _ sold ( representing the number of cups sold ) and price _ per _ cup (

Define a function that takes two parameters: cups_sold (representing the number of cups sold) and
price_per_cup (representing the price per cup). Inside the function, calculate the total revenue by multiplying the
number of cups sold by the price per cup and return the result.
Create a dictionary named coffee_menu where keys represent the names of coffee beverages (e.g., "Espresso",
"Latte", "Cappuccino"), and values represent the prices per cup for each beverage. You can determine the prices
for each beverage according to your preferences or assumptions.
Define another function that takes a dictionary sales_data as input. Inside this function, iterate through the
sales_data dictionary. For each coffee beverage in the dictionary, use the calculate_revenue function to calculate
the revenue generated by that beverage, and sum up the results to obtain the total revenue generated from all
coffee sales. Finally, return the total revenue.
To test the program, create a sample sales_data dictionary with the number of cups sold for each coffee type.
Afterward, call the function defined above for calculating revenue for the total coffee with this sales_data
dictionary as input and print the total revenue generated. This will ensure the correctness of the
implementation. Adjust the values in the sales_data dictionary according to your requirements for testing. For
example, the output might resemble:
 Define a function that takes two parameters: cups_sold (representing the number

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!